|
1 | 1 | import path from 'path';
|
2 | 2 | import { createWebpackDevServerDriver } from './driver/WebpackDevServerDriver';
|
| 3 | +import semver from 'semver'; |
3 | 4 |
|
4 | 5 | describe('TypeScript Watch API', () => {
|
5 | 6 | it.each([{ async: false }, { async: true }])(
|
@@ -209,10 +210,10 @@ describe('TypeScript Watch API', () => {
|
209 | 210 | );
|
210 | 211 |
|
211 | 212 | it.each([
|
212 |
| - { async: true, typescript: '2.7.1', 'ts-loader': '^5.0.0' }, |
213 |
| - { async: false, typescript: '~3.0.0', 'ts-loader': '^6.0.0' }, |
214 |
| - { async: true, typescript: '~3.6.0', 'ts-loader': '^7.0.0' }, |
215 |
| - { async: false, typescript: '~3.8.0', 'ts-loader': '^6.0.0' }, |
| 213 | + { async: true, typescript: '~3.6.0', 'ts-loader': '^6.0.0' }, |
| 214 | + { async: false, typescript: '~3.8.0', 'ts-loader': '^7.0.0' }, |
| 215 | + { async: true, typescript: '~4.0.0', 'ts-loader': '^8.0.0' }, |
| 216 | + { async: false, typescript: '~4.3.0', 'ts-loader': '^8.0.0' }, |
216 | 217 | ])('reports semantic error for %p', async ({ async, ...dependencies }) => {
|
217 | 218 | await sandbox.load(path.join(__dirname, 'fixtures/typescript-basic'));
|
218 | 219 | await sandbox.install('yarn', { ...dependencies });
|
@@ -277,7 +278,9 @@ describe('TypeScript Watch API', () => {
|
277 | 278 | expect(errors).toContain(
|
278 | 279 | [
|
279 | 280 | 'ERROR in ./src/index.ts 1:23-39',
|
280 |
| - "TS2307: Cannot find module './authenticate'.", |
| 281 | + semver.satisfies(semver.minVersion(dependencies.typescript), '>=4.0.0') |
| 282 | + ? "TS2307: Cannot find module './authenticate' or its corresponding type declarations." |
| 283 | + : "TS2307: Cannot find module './authenticate'.", |
281 | 284 | " > 1 | import { login } from './authenticate';",
|
282 | 285 | ' | ^^^^^^^^^^^^^^^^',
|
283 | 286 | " 2 | import { getUserName } from './model/User';",
|
|
0 commit comments