diff --git a/packages/data-context/src/actions/MigrationActions.ts b/packages/data-context/src/actions/MigrationActions.ts index d7d42d9f41af..ecd43dc46645 100644 --- a/packages/data-context/src/actions/MigrationActions.ts +++ b/packages/data-context/src/actions/MigrationActions.ts @@ -32,9 +32,6 @@ 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) @@ -91,23 +88,6 @@ 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 c287d58bb7b9..ca82ed4f3f09 100644 --- a/packages/data-context/src/data/ProjectConfigIpc.ts +++ b/packages/data-context/src/data/ProjectConfigIpc.ts @@ -3,11 +3,10 @@ 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, hasTypeScriptInstalled } from '../util' +import { autoBindDebug } from '../util' import _ from 'lodash' const pkg = require('@packages/root') @@ -15,9 +14,6 @@ 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 { @@ -242,59 +238,6 @@ 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 21a9e644f19a..1ae545c3dd1f 100644 --- a/packages/data-context/src/data/ProjectConfigManager.ts +++ b/packages/data-context/src/data/ProjectConfigManager.ts @@ -260,17 +260,10 @@ 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 deleted file mode 100644 index f87fb2bf050b..000000000000 --- a/packages/data-context/src/util/hasTypescript.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 dc6a9ab75ef5..f1ed3bc6d64b 100644 --- a/packages/data-context/src/util/index.ts +++ b/packages/data-context/src/util/index.ts @@ -6,6 +6,5 @@ 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 deleted file mode 100644 index 8a93c00fa23b..000000000000 --- a/packages/data-context/test/unit/util/hasTypescript.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -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 5d12886b3aec..b7ee7543e613 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:10') + cy.get('[data-testid="error-code-frame"]').should('contain', 'cypress.config.ts:6:9') }) }) diff --git a/packages/launchpad/cypress/e2e/error-handling.cy.ts b/packages/launchpad/cypress/e2e/error-handling.cy.ts index 66e932e0041e..9287a56f5c40 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.ts', ` + ctx.actions.file.writeFileInProject('cypress.config.js', ` 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 deleted file mode 100644 index 847d3380249b..000000000000 --- a/packages/server/lib/plugins/child/register_ts_node.js +++ /dev/null @@ -1,16 +0,0 @@ -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 4528392d6c23..2c4aba824600 100644 --- a/packages/server/lib/plugins/child/run_require_async_child.js +++ b/packages/server/lib/plugins/child/run_require_async_child.js @@ -1,11 +1,12 @@ require('graceful-fs').gracefulify(require('fs')) const stripAnsi = require('strip-ansi') -const debugLib = require('debug') +const debug = require('debug')(`cypress:lifecycle:child:run_require_async_child:${process.pid}`) const { pathToFileURL } = require('url') +const tsNodeUtil = require('./ts_node') const util = require('../util') const { RunPlugins } = require('./run_plugins') -const debug = debugLib(`cypress:lifecycle:child:run_require_async_child:${process.pid}`) +let tsRegistered = false /** * Executes and returns the passed `file` (usually `configFile`) file in the ipc `loadConfig` event @@ -21,6 +22,14 @@ 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)) @@ -83,9 +92,14 @@ function run (ipc, file, projectRoot) { // Config file loading of modules is tested within // system-tests/projects/config-cjs-and-esm/* const loadFile = async (file) => { - try { - debug('Loading file %s', 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 { return require(file) } catch (err) { if (!err.stack.includes('[ERR_REQUIRE_ESM]') && !err.stack.includes('SyntaxError: Cannot use import statement outside a module')) { @@ -96,16 +110,25 @@ function run (ipc, file, projectRoot) { debug('User is loading an ESM config file') try { - // 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('Trying to use esbuild to run their config file.') + // We prefer doing this because it supports TypeScript files + require.resolve('esbuild', { paths: [process.cwd()] }) - debug(`importing esm file %s`, fileURL) + debug(`They have esbuild, so we'll load the configFile via bundleRequire`) + const { bundleRequire } = require('bundle-require') - return await import(fileURL) + return (await bundleRequire({ filepath: file })).mod } catch (err) { - debug('error loading file via native Node.js module loader %s', err.message) + 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) + } + 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 9cfebc3a2750..ca0b332fd164 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,6 +1,8 @@ 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 () { @@ -15,6 +17,28 @@ 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-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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "devDependencies": { - "typescript": "4.7.3" - }, - "projectFixtureDirectory": "simple_passing" -} diff --git a/system-tests/project-fixtures/simple_passing/src/foo.ts b/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/src/foo.ts similarity index 100% rename from system-tests/project-fixtures/simple_passing/src/foo.ts rename to system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/src/foo.ts 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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-cjs-tsconfig-es5/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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/project-fixtures/simple_passing/cypress/e2e/app.cy.js b/system-tests/projects/config-cjs-and-esm/config-with-cjs/cypress/e2e/app.cy.js similarity index 100% rename from system-tests/project-fixtures/simple_passing/cypress/e2e/app.cy.js rename to system-tests/projects/config-cjs-and-esm/config-with-cjs/cypress/e2e/app.cy.js 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 deleted file mode 100644 index 8a5a20589141..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-cjs/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# 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 new file mode 100644 index 000000000000..92e444116c98 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-module/cypress/e2e/app.cy.js @@ -0,0 +1,3 @@ +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 b576372ebfa7..3dbc1ca591c0 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,4 +1,3 @@ { - "type": "module", - "projectFixtureDirectory": "simple_passing" + "type": "module" } 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 deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-module/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# 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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 new file mode 100644 index 000000000000..46448c0fd6a3 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/src/foo.ts @@ -0,0 +1 @@ +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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es2015/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 new file mode 100644 index 000000000000..46448c0fd6a3 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/src/foo.ts @@ -0,0 +1 @@ +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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es3/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 new file mode 100644 index 000000000000..46448c0fd6a3 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/src/foo.ts @@ -0,0 +1 @@ +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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-js-tsconfig-es5/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 new file mode 100644 index 000000000000..46448c0fd6a3 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/src/foo.ts @@ -0,0 +1 @@ +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 c7de3f699a22..98c470f93961 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,6 +6,7 @@ "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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs-tsconfig-es5/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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 new file mode 100644 index 000000000000..92e444116c98 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-mjs/cypress/e2e/app.cy.js @@ -0,0 +1,3 @@ +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 deleted file mode 100644 index 8a5a20589141..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index fb57ccd13afb..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-mjs/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# 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 new file mode 100644 index 000000000000..92e444116c98 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/cypress/e2e/app.cy.js @@ -0,0 +1,3 @@ +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 c51b9ac1e17e..c4b4e66fca18 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,8 +1,6 @@ { "devDependencies": { - "esbuild": "0.14.25", - "typescript": "4.7.3" + "esbuild": "0.14.25" }, - "type": "module", - "projectFixtureDirectory": "simple_passing" + "type": "module" } 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 deleted file mode 100644 index 7c3d58f844b4..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-and-esbuild/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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 dc62f9d74742..32ab7274b41b 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,8 +127,3 @@ 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 c3ce658e8927..c9d48b8594c2 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,7 +3,6 @@ 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 dc736e57df85..794a034007ef 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,9 +2,7 @@ "devDependencies": { "@cypress/vite-dev-server": "^2.0.0", "find-up": "6.3.0", - "typescript": "4.7.3", "vite": "2.8.6" }, - "type": "module", - "projectFixtureDirectory": "simple_passing" + "type": "module" } 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 new file mode 100644 index 000000000000..92e444116c98 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/src/app.cy.js @@ -0,0 +1,3 @@ +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 deleted file mode 100644 index 7c3d58f844b4..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module-component/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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 3d0b4f6c5c28..59aca2feffe2 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,11 +261,6 @@ 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 new file mode 100644 index 000000000000..92e444116c98 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-module/cypress/e2e/app.cy.js @@ -0,0 +1,3 @@ +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 8212f73d457c..bfdb19123131 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,8 +1,6 @@ { "dependencies": { - "find-up": "6.3.0", - "typescript": "4.7.3" + "find-up": "6.3.0" }, - "type": "module", - "projectFixtureDirectory": "simple_passing" + "type": "module" } 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 deleted file mode 100644 index 7c3d58f844b4..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-module/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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 45c050b2a6f0..ffbb99ff595c 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,11 +36,6 @@ 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 new file mode 100644 index 000000000000..764540993c64 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/cypress/e2e/app.cy.js @@ -0,0 +1,7 @@ +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 deleted file mode 100644 index 2e4ad67943ca..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 new file mode 100644 index 000000000000..46448c0fd6a3 --- /dev/null +++ b/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/src/foo.ts @@ -0,0 +1 @@ +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 deleted file mode 100644 index 6774dcd69294..000000000000 --- a/system-tests/projects/config-cjs-and-esm/config-with-ts-tsconfig-es5/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# 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 deleted file mode 100644 index fbe848f4bd7e..000000000000 --- a/system-tests/projects/config-cjs-and-esm/ts-cjs-with-invalid-esm-only-import/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "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.ts b/system-tests/projects/missing-vite-config/cypress.config.js similarity index 100% rename from system-tests/projects/missing-vite-config/cypress.config.ts rename to system-tests/projects/missing-vite-config/cypress.config.js diff --git a/system-tests/projects/missing-vite-config/package.json b/system-tests/projects/missing-vite-config/package.json index 667447b4a9a1..b0a81f11fbaa 100644 --- a/system-tests/projects/missing-vite-config/package.json +++ b/system-tests/projects/missing-vite-config/package.json @@ -3,7 +3,6 @@ "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 fabe831af1de..06610934b37e 100644 --- a/system-tests/projects/missing-vite-config/yarn.lock +++ b/system-tests/projects/missing-vite-config/yarn.lock @@ -202,11 +202,6 @@ 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 cabcb190a23c..fc727a36c8ea 100644 --- a/system-tests/test/config_modules_spec.ts +++ b/system-tests/test/config_modules_spec.ts @@ -8,7 +8,6 @@ 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', @@ -23,12 +22,30 @@ describe('cypress config with esm and cjs', function () { }) }) - 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, + // 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, + }) }) })