|
1 | 1 | import { jsonNoCache as runWithJsonNoCache } from '../run-jest'; |
2 | 2 |
|
3 | | -describe('hoisting', () => { |
4 | | - const DIR = 'ast-transformers/hoisting'; |
5 | | - |
6 | | - test(`successfully runs the tests inside ${DIR} with isolatedModules: false`, () => { |
7 | | - const { json } = runWithJsonNoCache(DIR); |
| 3 | +const executeTest = (dirName: string): void => { |
| 4 | + test(`successfully runs the tests inside ${dirName} with isolatedModules: false`, () => { |
| 5 | + const { json } = runWithJsonNoCache(dirName); |
8 | 6 |
|
9 | 7 | expect(json.success).toBe(true); |
10 | 8 | }); |
11 | 9 |
|
12 | | - test(`successfully runs the tests inside ${DIR} with isolatedModules: true`, () => { |
13 | | - const { json } = runWithJsonNoCache(DIR, ['-c=jest-isolated.config.js']); |
| 10 | + test(`successfully runs the tests inside ${dirName} with isolatedModules: true`, () => { |
| 11 | + const { json } = runWithJsonNoCache(dirName, ['-c=jest-isolated.config.js']); |
14 | 12 |
|
15 | 13 | expect(json.success).toBe(true); |
16 | 14 | }); |
| 15 | +}; |
| 16 | + |
| 17 | +describe('hoisting', () => { |
| 18 | + executeTest('ast-transformers/hoisting'); |
17 | 19 | }); |
18 | 20 |
|
19 | 21 | describe('ng-jit-transformers', () => { |
20 | | - const DIR = 'ast-transformers/ng-jit-transformers'; |
21 | | - |
22 | | - test(`successfully runs the tests inside ${DIR} with isolatedModules: false`, () => { |
23 | | - const { json } = runWithJsonNoCache(DIR); |
24 | | - |
25 | | - expect(json.success).toBe(true); |
26 | | - }); |
27 | | - |
28 | | - test(`successfully runs the tests inside ${DIR} with isolatedModules: true`, () => { |
29 | | - const { json } = runWithJsonNoCache(DIR, ['-c=jest-isolated.config.js']); |
30 | | - |
31 | | - expect(json.success).toBe(true); |
32 | | - }); |
| 22 | + executeTest('ast-transformers/ng-jit-transformers'); |
33 | 23 | }); |
0 commit comments