diff --git a/README.md b/README.md index 62081ca..cb7589d 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,7 @@ Just use `"test": "exodus-test"` - `--jest` -- register jest test helpers as global variables, also load `jest.config.*` configuration options -- `--typescript` -- use typescript loader (which also compiles esm to cjs where needed) - -- `--esbuild` -- use esbuild loader (currently an alias for `--typescript`) +- `--esbuild` -- use esbuild loader, also enables Typescript support - `--babel` -- use babel loader (slower than `--esbuild`, makes sense if you have a special config) diff --git a/bin/index.js b/bin/index.js index 42b003a..0ebda46 100755 --- a/bin/index.js +++ b/bin/index.js @@ -52,7 +52,9 @@ function parseOptions() { options.jest = true break case '--typescript': + console.warn('Option --typescript is going to be gone or changed. Use --esbuild instead') options.typescript = true + options.esbuild = true break case '--esbuild': options.esbuild = true @@ -148,7 +150,7 @@ if (options.coverage) { } } -if (options.typescript || options.esbuild) { +if (options.esbuild) { if (major >= 22 || (major === 20 && minor >= 6) || (major === 18 && minor >= 18)) { assert(resolveImport) args.push('--import', resolveImport('tsx')) @@ -158,7 +160,7 @@ if (options.typescript || options.esbuild) { } if (options.babel) { - assert(!options.typescript, 'Options --babel and --typescript are mutually exclusive') + assert(!options.esbuild, 'Options --babel and --esbuild are mutually exclusive') args.push('-r', resolveRequire('./babel.cjs')) } @@ -267,8 +269,8 @@ if (options.debug.files) { } const tsTests = files.filter((file) => /\.[mc]?tsx?$/u.test(file)) -if (tsTests.length > 0 && !options.typescript) { - console.error(`Some tests require --typescript flag:\n ${tsTests.join('\n ')}`) +if (tsTests.length > 0 && !options.esbuild) { + console.error(`Some tests require --esbuild flag:\n ${tsTests.join('\n ')}`) process.exit(1) } else if (!allfiles.some((file) => file.endsWith('.ts')) && options.typescript) { console.warn(`Flag --typescript has been used, but there were no TypeScript tests found!`) diff --git a/package.json b/package.json index cb9c4af..022fc48 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "CHANGELOG.md" ], "scripts": { - "test": "./bin/index.js --jest --typescript", + "test": "./bin/index.js --jest --esbuild", "test:tape": "./bin/index.js --esbuild '__test__/tape/test/*.js' __test__/tape.test.js", - "coverage": "./bin/index.js --jest --typescript --coverage", + "coverage": "./bin/index.js --jest --esbuild --coverage", "lint": "prettier --list-different . && eslint .", "lint:fix": "prettier --write . && eslint --fix ." },