mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-26 00:50:41 -05:00
9b3b023aa0
* feat: replace tsnode with tsx for parsing user configuration in all cases * bump ubuntu images from node 18 to 20 as node 18 is not supported in cypress 15 and allows us to not include the 18.19.0 workaround to use --import with tsx inside the ProjectConfigIpc * fix: issues finding tsx on windows as it needs the file:// protocol as absolute drive paths are not recognized as a file protocol in the node context * make sure to filter out stack code correctly for windows * fix: fix flake from windows on reporter menu not expanding (unrelated to this PR and should be merged into develop) * chore: update changelog with all issues tsx cutover closes * fix merge conflicts * chore: add regression tests for cypress projects that previously did not work but now do with tsx * build all binaries * chore: address issues from code review * update changelog * remove todo comment on testing legacy migration with tsx * refactor codeFrame calculation into a util function and add a unit test * updated node versions in project config ipc tests to remove 18 and test threshold / latest values. Removed redundant comments on ts-node.
59 lines
1.9 KiB
TypeScript
59 lines
1.9 KiB
TypeScript
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',
|
|
// covers use cases that now work with tsx
|
|
'config-cjs-and-esm/config-with-ts-extends',
|
|
'config-cjs-and-esm/config-with-ts-module-no-tsconfig',
|
|
// 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-es2015',
|
|
'config-cjs-and-esm/config-with-module-resolution-bundler',
|
|
].forEach((project) => {
|
|
systemTests.it(`${project}`, {
|
|
project,
|
|
testingType: 'e2e',
|
|
spec: 'app.cy.js',
|
|
browser: 'chrome',
|
|
expectedExitCode: 0,
|
|
})
|
|
})
|
|
})
|