diff --git a/packages/data-context/src/actions/MigrationActions.ts b/packages/data-context/src/actions/MigrationActions.ts index ecd43dc46645..d7d42d9f41af 100644 --- a/packages/data-context/src/actions/MigrationActions.ts +++ b/packages/data-context/src/actions/MigrationActions.ts @@ -32,6 +32,9 @@ import { } from '../sources/migration' import { makeCoreData } from '../data' import { LegacyPluginsIpc } from '../data/LegacyPluginsIpc' +import { hasTypeScriptInstalled } from '../util' + +const tsNode = require.resolve('@packages/server/lib/plugins/child/register_ts_node') export function getConfigWithDefaults (legacyConfig: any) { const newConfig = _.cloneDeep(legacyConfig) @@ -88,6 +91,23 @@ export async function processConfigViaLegacyPlugins (projectRoot: string, legacy const configProcessArgs = ['--projectRoot', projectRoot, '--file', cwd] const CHILD_PROCESS_FILE_PATH = require.resolve('@packages/server/lib/plugins/child/require_async_child') + // use ts-node if they've got typescript installed + // this matches the 9.x behavior, which is what we want for + // processing legacy pluginsFile (we never supported `"type": "module") in 9.x. + if (hasTypeScriptInstalled(projectRoot)) { + const tsNodeLoader = `--require ${tsNode}` + + if (!childOptions.env) { + childOptions.env = {} + } + + if (childOptions.env.NODE_OPTIONS) { + childOptions.env.NODE_OPTIONS += ` ${tsNodeLoader}` + } else { + childOptions.env.NODE_OPTIONS = tsNodeLoader + } + } + const childProcess = fork(CHILD_PROCESS_FILE_PATH, configProcessArgs, childOptions) const ipc = new LegacyPluginsIpc(childProcess) diff --git a/packages/data-context/src/data/ProjectConfigIpc.ts b/packages/data-context/src/data/ProjectConfigIpc.ts index ca82ed4f3f09..c287d58bb7b9 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -3,10 +3,11 @@ import { CypressError, getError } from '@packages/errors' import type { FullConfig, TestingType } from '@packages/types' import { ChildProcess, fork, ForkOptions } from 'child_process' import EventEmitter from 'events' +import fs from 'fs-extra' import path from 'path' import inspector from 'inspector' import debugLib from 'debug' -import { autoBindDebug } from '../util' +import { autoBindDebug, hasTypeScriptInstalled } from '../util' import _ from 'lodash' const pkg = require('@packages/root') @@ -14,6 +15,9 @@ const debug = debugLib(`cypress:lifecycle:ProjectConfigIpc`) const CHILD_PROCESS_FILE_PATH = require.resolve('@packages/server/lib/plugins/child/require_async_child') +const tsNodeEsm = require.resolve('ts-node/esm/transpile-only') +const tsNode = require.resolve('@packages/server/lib/plugins/child/register_ts_node') + export type IpcHandler = (ipc: ProjectConfigIpc) => void export interface SetupNodeEventsReply { @@ -238,6 +242,59 @@ export class ProjectConfigIpc extends EventEmitter { debug('fork child process %o', { CHILD_PROCESS_FILE_PATH, configProcessArgs, childOptions: _.omit(childOptions, 'env') }) + let isProjectUsingESModules = false + + try { + const pkgJson = fs.readJsonSync(path.join(this.projectRoot, 'package.json')) + + isProjectUsingESModules = pkgJson.type === 'module' + } catch (e) { + // project does not have `package.json` or it was not found + // reasonable to assume not using es modules + } + + if (!childOptions.env) { + childOptions.env = {} + } + + // If they've got TypeScript installed, we can use + // ts-node for CommonJS + // ts-node/esm for ESM + if (hasTypeScriptInstalled(this.projectRoot)) { + if (isProjectUsingESModules) { + // Use the ts-node/esm loader so they can use TypeScript with `"type": "module". + // The loader API is experimental and will change. + // The same can be said for the other alternative, esbuild, so this is the + // best option that leverages the existing modules we bundle in the binary. + // @see ts-node esm loader https://typestrong.org/ts-node/docs/usage/#node-flags-and-other-tools + // @see Node.js Loader API https://nodejs.org/api/esm.html#customizing-esm-specifier-resolution-algorithm + const tsNodeEsmLoader = `--experimental-specifier-resolution=node --loader ${tsNodeEsm}` + + if (childOptions.env.NODE_OPTIONS) { + childOptions.env.NODE_OPTIONS += ` ${tsNodeEsmLoader}` + } else { + childOptions.env.NODE_OPTIONS = tsNodeEsmLoader + } + } else { + // Not using ES Modules (via "type": "module"), + // so we just register the standard ts-node module + // to handle TypeScript that is compiled to CommonJS. + // We do NOT use the `--loader` flag because we have some additional + // custom logic for ts-node when used with CommonJS that needs to be evaluated + // so we need to load and evaluate the hook first using the `--require` module API. + const tsNodeLoader = `--require ${tsNode}` + + if (childOptions.env.NODE_OPTIONS) { + childOptions.env.NODE_OPTIONS += ` ${tsNodeLoader}` + } else { + childOptions.env.NODE_OPTIONS = tsNodeLoader + } + } + } else { + // Just use Node's built-in ESM support. + // TODO: Consider using userland `esbuild` with Node's --loader API to handle ESM. + } + const proc = fork(CHILD_PROCESS_FILE_PATH, configProcessArgs, childOptions) return proc diff --git a/packages/data-context/src/data/ProjectConfigManager.ts b/packages/data-context/src/data/ProjectConfigManager.ts index 1ae545c3dd1f..21a9e644f19a 100644 --- a/packages/data-context/src/data/ProjectConfigManager.ts +++ b/packages/data-context/src/data/ProjectConfigManager.ts @@ -260,10 +260,17 @@ export class ProjectConfigManager { this._eventsIpc.cleanupIpc() } - this._eventsIpc = new ProjectConfigIpc(this.options.ctx.nodePath, this.options.projectRoot, this.configFilePath, this.options.configFile, (cypressError: CypressError, title?: string | undefined) => { - this._state = 'errored' - this.options.ctx.onError(cypressError, title) - }, this.options.ctx.onWarning) + this._eventsIpc = new ProjectConfigIpc( + this.options.ctx.nodePath, + this.options.projectRoot, + this.configFilePath, + this.options.configFile, + (cypressError: CypressError, title?: string | undefined) => { + this._state = 'errored' + this.options.ctx.onError(cypressError, title) + }, + this.options.ctx.onWarning, + ) this._loadConfigPromise = this._eventsIpc.loadConfig() } diff --git a/packages/data-context/src/util/hasTypescript.ts b/packages/data-context/src/util/hasTypescript.ts new file mode 100644 index 000000000000..f87fb2bf050b --- /dev/null +++ b/packages/data-context/src/util/hasTypescript.ts @@ -0,0 +1,9 @@ +export function hasTypeScriptInstalled (projectRoot: string) { + try { + require.resolve('typescript', { paths: [projectRoot] }) + + return true + } catch (e) { + return false + } +} diff --git a/packages/data-context/src/util/index.ts b/packages/data-context/src/util/index.ts index f1ed3bc6d64b..dc6a9ab75ef5 100644 --- a/packages/data-context/src/util/index.ts +++ b/packages/data-context/src/util/index.ts @@ -6,5 +6,6 @@ export * from './autoBindDebug' export * from './cached' export * from './config-file-updater' export * from './file' +export * from './hasTypescript' export * from './pluginHandlers' export * from './urqlCacheKeys' diff --git a/packages/data-context/test/unit/util/hasTypescript.spec.ts b/packages/data-context/test/unit/util/hasTypescript.spec.ts new file mode 100644 index 000000000000..8a93c00fa23b --- /dev/null +++ b/packages/data-context/test/unit/util/hasTypescript.spec.ts @@ -0,0 +1,18 @@ +import { expect } from 'chai' +import path from 'path' +import { hasTypeScriptInstalled } from '../../../src/util' +import { scaffoldMigrationProject } from '../helper' + +describe('hasTypeScript', () => { + it('returns true when installed', async () => { + const monorepoRoot = path.join(__dirname, '..', '..', '..', '..', '..') + + expect(hasTypeScriptInstalled(monorepoRoot)).to.be.true + }) + + it('returns false when not installed', async () => { + const projectRoot = await scaffoldMigrationProject('config-with-js') + + expect(hasTypeScriptInstalled(projectRoot)).to.be.false + }) +}) diff --git a/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts b/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts index b7ee7543e613..5d12886b3aec 100644 --- a/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts +++ b/packages/launchpad/cypress/e2e/config-files-error-handling.cy.ts @@ -173,7 +173,7 @@ describe('Launchpad: Error System Tests', () => { cy.contains('h1', cy.i18n.launchpadErrors.generic.configErrorTitle) cy.percySnapshot() - cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.ts:6:9') + cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.ts:6:10') }) }) diff --git a/packages/launchpad/cypress/e2e/error-handling.cy.ts b/packages/launchpad/cypress/e2e/error-handling.cy.ts index 9287a56f5c40..66e932e0041e 100644 --- a/packages/launchpad/cypress/e2e/error-handling.cy.ts +++ b/packages/launchpad/cypress/e2e/error-handling.cy.ts @@ -80,7 +80,7 @@ describe('Error handling', () => { cy.contains('Choose a Browser').should('not.exist') cy.withCtx((ctx) => { - ctx.actions.file.writeFileInProject('cypress.config.js', ` + ctx.actions.file.writeFileInProject('cypress.config.ts', ` import { defineConfig } from 'cypress' import { defineConfig as viteConfig } from 'vite' export default defineConfig({ diff --git a/packages/server/lib/plugins/child/register_ts_node.js b/packages/server/lib/plugins/child/register_ts_node.js new file mode 100644 index 000000000000..847d3380249b --- /dev/null +++ b/packages/server/lib/plugins/child/register_ts_node.js @@ -0,0 +1,16 @@ +const minimist = require('minimist') +const debugLib = require('debug') +const { register } = require('./ts_node') + +const debug = debugLib('cypress:server:register-ts-node') + +const args = minimist(process.argv) + +debug('executing register_ts_node with args %o', args) + +const { projectRoot, file } = args + +if (projectRoot && file) { + debug('registering ts-node for projectRoot: %s and file: %s', projectRoot, file) + register(projectRoot, file) +} diff --git a/packages/server/lib/plugins/child/run_require_async_child.js b/packages/server/lib/plugins/child/run_require_async_child.js index 2c4aba824600..4528392d6c23 100644 --- a/packages/server/lib/plugins/child/run_require_async_child.js +++ b/packages/server/lib/plugins/child/run_require_async_child.js @@ -1,12 +1,11 @@ require('graceful-fs').gracefulify(require('fs')) const stripAnsi = require('strip-ansi') -const debug = require('debug')(`cypress:lifecycle:child:run_require_async_child:${process.pid}`) +const debugLib = require('debug') const { pathToFileURL } = require('url') -const tsNodeUtil = require('./ts_node') const util = require('../util') const { RunPlugins } = require('./run_plugins') -let tsRegistered = false +const debug = debugLib(`cypress:lifecycle:child:run_require_async_child:${process.pid}`) /** * Executes and returns the passed `file` (usually `configFile`) file in the ipc `loadConfig` event @@ -22,14 +21,6 @@ function run (ipc, file, projectRoot) { throw new Error('Unexpected: projectRoot should be a string') } - if (!tsRegistered) { - debug('register typescript for required file') - tsNodeUtil.register(projectRoot, file) - - // ensure typescript is only registered once - tsRegistered = true - } - process.on('uncaughtException', (err) => { debug('uncaught exception:', util.serializeError(err)) ipc.send('childProcess:unhandledError', util.serializeError(err)) @@ -92,14 +83,9 @@ function run (ipc, file, projectRoot) { // Config file loading of modules is tested within // system-tests/projects/config-cjs-and-esm/* const loadFile = async (file) => { - // 1. Try loading the configFile - // 2. Catch the "ERR_REQUIRE_ESM" error - // 3. Check if esbuild is installed - // 3a. Yes: Use bundleRequire - // 3b. No: Continue through to `await import(configFile)` - // 4. Use node's dynamic import to import the configFile - try { + debug('Loading file %s', file) + return require(file) } catch (err) { if (!err.stack.includes('[ERR_REQUIRE_ESM]') && !err.stack.includes('SyntaxError: Cannot use import statement outside a module')) { @@ -110,25 +96,16 @@ function run (ipc, file, projectRoot) { debug('User is loading an ESM config file') try { - debug('Trying to use esbuild to run their config file.') - // We prefer doing this because it supports TypeScript files - require.resolve('esbuild', { paths: [process.cwd()] }) + // We cannot replace the initial `require` with `await import` because + // Certain modules cannot be dynamically imported. + // pathToFileURL for windows interop: https://github.com/nodejs/node/issues/31710 + const fileURL = pathToFileURL(file).href - debug(`They have esbuild, so we'll load the configFile via bundleRequire`) - const { bundleRequire } = require('bundle-require') + debug(`importing esm file %s`, fileURL) - return (await bundleRequire({ filepath: file })).mod + return await import(fileURL) } catch (err) { - if (err.stack.includes(`Cannot find module 'esbuild'`)) { - debug(`User doesn't have esbuild. Going to use native node imports.`) - - // We cannot replace the initial `require` with `await import` because - // Certain modules cannot be dynamically imported. - - // pathToFileURL for windows interop: https://github.com/nodejs/node/issues/31710 - return await import(pathToFileURL(file).href) - } - + debug('error loading file via native Node.js module loader %s', err.message) throw err } } diff --git a/packages/server/test/unit/plugins/child/run_require_async_child_spec.js b/packages/server/test/unit/plugins/child/run_require_async_child_spec.js index ca0b332fd164..9cfebc3a2750 100644 --- a/packages/server/test/unit/plugins/child/run_require_async_child_spec.js +++ b/packages/server/test/unit/plugins/child/run_require_async_child_spec.js @@ -1,8 +1,6 @@ require('../../../spec_helper') -const tsNodeUtil = require('../../../../lib/plugins/child/ts_node') const runRequireAsyncChild = require('../../../../lib/plugins/child/run_require_async_child') -const resolve = require('../../../../lib/util/resolve') describe('lib/plugins/child/run_require_async_child', () => { beforeEach(function () { @@ -17,28 +15,6 @@ describe('lib/plugins/child/run_require_async_child', () => { mockery.deregisterMock('@cypress/webpack-batteries-included-preprocessor') }) - describe('typescript registration', () => { - beforeEach(() => { - sinon.stub(tsNodeUtil, 'register') - sinon.stub(resolve, 'typescript').returns('/path/to/typescript.js') - }) - - it('registers ts-node only once when typescript module found', function () { - runRequireAsyncChild(this.ipc, 'cypress.config.js', 'proj-root') - runRequireAsyncChild(this.ipc, 'cypress.config.js', 'proj-root') - - expect(tsNodeUtil.register).to.be.calledWith( - 'proj-root', - 'cypress.config.js', - ) - - expect(tsNodeUtil.register).to.be.calledOnce - }) - - // FIXME: need to validate that TS is checked once when ts is not found as well - it.skip('checks for typescript only once if typescript module was not found') - }) - describe('errors', () => { beforeEach(function () { sinon.stub(process, 'on') diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs/cypress/e2e/app.cy.js b/system-tests/project-fixtures/simple_passing/cypress/e2e/app.cy.js similarity index 100% rename from system-tests/projects/config-cjs-and-esm/config-with-cjs/cypress/e2e/app.cy.js rename to system-tests/project-fixtures/simple_passing/cypress/e2e/app.cy.js diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/src/foo.ts b/system-tests/project-fixtures/simple_passing/src/foo.ts similarity index 100% rename from system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/src/foo.ts rename to system-tests/project-fixtures/simple_passing/src/foo.ts diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/package.json b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs/package.json b/system-tests/projects/config-cjs-and-esm/config-with-cjs/package.json new file mode 100644 index 000000000000..8a5a20589141 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-cjs/package.json @@ -0,0 +1,3 @@ +{ + "projectFixtureDirectory": "simple_passing" +} \ No newline at end of file diff --git a/system-tests/projects/config-cjs-and-esm/config-with-cjs/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-cjs/yarn.lock new file mode 100644 index 000000000000..fb57ccd13afb --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-cjs/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-module/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-js-module/cypress/e2e/app.cy.js deleted file mode 100644 index 92e444116c98..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-module/cypress/e2e/app.cy.js +++ /dev/null @@ -1,3 +0,0 @@ -it('works', () => { - expect(true).to.be.true -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-module/package.json b/system-tests/projects/config-cjs-and-esm/config-with-js-module/package.json index 3dbc1ca591c0..b576372ebfa7 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-module/package.json +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-module/package.json @@ -1,3 +1,4 @@ { - "type": "module" + "type": "module", + "projectFixtureDirectory": "simple_passing" } diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-module/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-js-module/yarn.lock new file mode 100644 index 000000000000..fb57ccd13afb --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-module/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/package.json b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/src/foo.ts deleted file mode 100644 index 46448c0fd6a3..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export const numberOne = 1 diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/package.json b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/src/foo.ts deleted file mode 100644 index 46448c0fd6a3..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export const numberOne = 1 diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/package.json b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/src/foo.ts deleted file mode 100644 index 46448c0fd6a3..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export const numberOne = 1 diff --git a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/package.json b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/src/foo.ts deleted file mode 100644 index 46448c0fd6a3..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export const numberOne = 1 diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/tsconfig.json b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/tsconfig.json index 98c470f93961..c7de3f699a22 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/tsconfig.json +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/tsconfig.json @@ -6,7 +6,6 @@ "dom.iterable", "esnext" ], - "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-mjs/cypress/e2e/app.cy.js deleted file mode 100644 index 92e444116c98..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs/cypress/e2e/app.cy.js +++ /dev/null @@ -1,3 +0,0 @@ -it('works', () => { - expect(true).to.be.true -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs/package.json b/system-tests/projects/config-cjs-and-esm/config-with-mjs/package.json new file mode 100644 index 000000000000..8a5a20589141 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs/package.json @@ -0,0 +1,3 @@ +{ + "projectFixtureDirectory": "simple_passing" +} \ No newline at end of file diff --git a/system-tests/projects/config-cjs-and-esm/config-with-mjs/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-mjs/yarn.lock new file mode 100644 index 000000000000..fb57ccd13afb --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/cypress/e2e/app.cy.js deleted file mode 100644 index 92e444116c98..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/cypress/e2e/app.cy.js +++ /dev/null @@ -1,3 +0,0 @@ -it('works', () => { - expect(true).to.be.true -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/package.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/package.json index c4b4e66fca18..c51b9ac1e17e 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/package.json +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/package.json @@ -1,6 +1,8 @@ { "devDependencies": { - "esbuild": "0.14.25" + "esbuild": "0.14.25", + "typescript": "4.7.3" }, - "type": "module" + "type": "module", + "projectFixtureDirectory": "simple_passing" } diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/tsconfig.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/tsconfig.json new file mode 100644 index 000000000000..7c3d58f844b4 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "esnext", + "lib": ["es6"], + "moduleResolution": "node" + } +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/yarn.lock index 32ab7274b41b..dc62f9d74742 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/yarn.lock +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/yarn.lock @@ -127,3 +127,8 @@ esbuild@0.14.25: esbuild-windows-32 "0.14.25" esbuild-windows-64 "0.14.25" esbuild-windows-arm64 "0.14.25" + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/cypress.config.ts b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/cypress.config.ts index c9d48b8594c2..c3ce658e8927 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/cypress.config.ts +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/cypress.config.ts @@ -3,6 +3,7 @@ import { devServer } from '@cypress/vite-dev-server' export default defineConfig({ component: { + specPattern: 'src/**/*.ts', supportFile: false, async setupNodeEvents (_, config) { await import('find-up') diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/package.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/package.json index 794a034007ef..dc736e57df85 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/package.json +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/package.json @@ -2,7 +2,9 @@ "devDependencies": { "@cypress/vite-dev-server": "^2.0.0", "find-up": "6.3.0", + "typescript": "4.7.3", "vite": "2.8.6" }, - "type": "module" + "type": "module", + "projectFixtureDirectory": "simple_passing" } diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/src/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/src/app.cy.js deleted file mode 100644 index 92e444116c98..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/src/app.cy.js +++ /dev/null @@ -1,3 +0,0 @@ -it('works', () => { - expect(true).to.be.true -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/tsconfig.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/tsconfig.json new file mode 100644 index 000000000000..7c3d58f844b4 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "esnext", + "lib": ["es6"], + "moduleResolution": "node" + } +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/yarn.lock index 59aca2feffe2..3d0b4f6c5c28 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/yarn.lock +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/yarn.lock @@ -261,6 +261,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity "sha1-btpL00SjyUrqN21MwxvHcxEDngk= sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== + vite@2.8.6: version "2.8.6" resolved "https://registry.yarnpkg.com/vite/-/vite-2.8.6.tgz#32d50e23c99ca31b26b8ccdc78b1d72d4d7323d3" diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/cypress/e2e/app.cy.js deleted file mode 100644 index 92e444116c98..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/cypress/e2e/app.cy.js +++ /dev/null @@ -1,3 +0,0 @@ -it('works', () => { - expect(true).to.be.true -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/package.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/package.json index bfdb19123131..8212f73d457c 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/package.json +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/package.json @@ -1,6 +1,8 @@ { "dependencies": { - "find-up": "6.3.0" + "find-up": "6.3.0", + "typescript": "4.7.3" }, - "type": "module" + "type": "module", + "projectFixtureDirectory": "simple_passing" } diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/tsconfig.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/tsconfig.json new file mode 100644 index 000000000000..7c3d58f844b4 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "esnext", + "lib": ["es6"], + "moduleResolution": "node" + } +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/yarn.lock index ffbb99ff595c..45c050b2a6f0 100644 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/yarn.lock +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/yarn.lock @@ -36,6 +36,11 @@ path-exists@^5.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" integrity "sha1-pqrZSJIAsh+rMeSc8JJ35RFvuec= sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==" +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== + yocto-queue@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/cypress/e2e/app.cy.js deleted file mode 100644 index 764540993c64..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/cypress/e2e/app.cy.js +++ /dev/null @@ -1,7 +0,0 @@ -import { numberOne } from '../../src/foo' - -it('works', () => { - const number = 1 - - expect(numberOne).to.equal(number) -}) diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/package.json b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/package.json new file mode 100644 index 000000000000..2e4ad67943ca --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/src/foo.ts deleted file mode 100644 index 46448c0fd6a3..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/src/foo.ts +++ /dev/null @@ -1 +0,0 @@ -export const numberOne = 1 diff --git a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/yarn.lock b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/yarn.lock new file mode 100644 index 000000000000..6774dcd69294 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== diff --git a/system-tests/projects/config-cjs-and-esm/ts-cjs-with-invalid-esm-only-import/package.json b/system-tests/projects/config-cjs-and-esm/ts-cjs-with-invalid-esm-only-import/package.json new file mode 100644 index 000000000000..fbe848f4bd7e --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/ts-cjs-with-invalid-esm-only-import/package.json @@ -0,0 +1,7 @@ +{ + "dependencies": { + "find-up": "6.3.0", + "typescript": "4.7.3" + }, + "projectFixtureDirectory": "simple_passing" +} \ No newline at end of file diff --git a/system-tests/projects/missing-vite-config/cypress.config.js b/system-tests/projects/missing-vite-config/cypress.config.ts similarity index 100% rename from system-tests/projects/missing-vite-config/cypress.config.js rename to system-tests/projects/missing-vite-config/cypress.config.ts diff --git a/system-tests/projects/missing-vite-config/package.json b/system-tests/projects/missing-vite-config/package.json index b0a81f11fbaa..667447b4a9a1 100644 --- a/system-tests/projects/missing-vite-config/package.json +++ b/system-tests/projects/missing-vite-config/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "devDependencies": { + "typescript": "4.7.3", "vite": "^2.8.0" } } diff --git a/system-tests/projects/missing-vite-config/yarn.lock b/system-tests/projects/missing-vite-config/yarn.lock index 06610934b37e..fabe831af1de 100644 --- a/system-tests/projects/missing-vite-config/yarn.lock +++ b/system-tests/projects/missing-vite-config/yarn.lock @@ -202,6 +202,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +typescript@4.7.3: + version "4.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d" + integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA== + vite@^2.8.0: version "2.9.9" resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.9.tgz#8b558987db5e60fedec2f4b003b73164cb081c5e" diff --git a/system-tests/test/config_modules_spec.ts b/system-tests/test/config_modules_spec.ts index fc727a36c8ea..cabcb190a23c 100644 --- a/system-tests/test/config_modules_spec.ts +++ b/system-tests/test/config_modules_spec.ts @@ -8,6 +8,7 @@ describe('cypress config with esm and cjs', function () { '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', // This covers Vite and SvelteKit e2e projects 'config-cjs-and-esm/config-with-ts-module-and-esbuild', @@ -22,30 +23,12 @@ describe('cypress config with esm and cjs', function () { }) }) - // TODO: add support for ts-node/esm https://github.com/cypress-io/cypress/issues/21939 - ;[ - 'config-cjs-and-esm/config-with-ts-module', - ].forEach((project) => { - systemTests.it(`does not support modules and ts without esbuild in ${project}`, { - project, - testingType: 'e2e', - spec: 'app.cy.js', - browser: 'chrome', - expectedExitCode: 1, - }) - }) - - ;[ - 'config-cjs-and-esm/config-with-ts-module-component', - ].forEach((project) => { - // This covers Vite and SvelteKit component testing projects - systemTests.it(`supports modules and cjs in ${project}`, { - project, - testingType: 'component', - spec: 'src/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, }) })