forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_modules_spec.ts
56 lines (50 loc) · 1.73 KB
/
config_modules_spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import systemTests from '../lib/system-tests'
// All projects live inside of projects/config-cjs-and-esm
describe('cypress config with esm and cjs', function () {
systemTests.setup()
;[
'config-cjs-and-esm/config-with-mjs',
'config-cjs-and-esm/config-with-cjs',
'config-cjs-and-esm/config-with-js-module',
'config-cjs-and-esm/config-with-ts-module',
'config-cjs-and-esm/config-node-next',
// This covers Vite and SvelteKit e2e projects
'config-cjs-and-esm/config-with-ts-module-and-esbuild',
'config-cjs-and-esm/config-with-ts-tsconfig-es5',
].forEach((project) => {
systemTests.it(`supports modules and cjs in ${project}`, {
project,
testingType: 'e2e',
spec: 'app.cy.js',
browser: 'chrome',
expectedExitCode: 0,
})
})
systemTests.it('supports modules and cjs in component testing', {
project: 'config-cjs-and-esm/config-with-ts-module-component',
testingType: 'component',
spec: 'src/foo.ts',
browser: 'chrome',
expectedExitCode: 0,
})
})
describe('compiles config files using the native node import', () => {
systemTests.setup()
;[
// esbuild chokes on these kinds of projects (JS Config File + TSConfig that's out of range)
// so this makes sure we're using the native node import
'config-cjs-and-esm/config-with-mjs-tsconfig-es5',
'config-cjs-and-esm/config-with-cjs-tsconfig-es5',
'config-cjs-and-esm/config-with-js-tsconfig-es5',
'config-cjs-and-esm/config-with-js-tsconfig-es3',
'config-cjs-and-esm/config-with-js-tsconfig-es2015',
].forEach((project) => {
systemTests.it(`${project}`, {
project,
testingType: 'e2e',
spec: 'app.cy.js',
browser: 'chrome',
expectedExitCode: 0,
})
})
})