From de31dd36ba0b0bee3307b74621c88e52428fffb5 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sun, 21 Aug 2022 18:43:27 +0300 Subject: [PATCH] Remove jest from core package, use vitest only --- packages/core/jest.config.cjs | 11 ----------- packages/core/jest.config.mjs | 10 ---------- packages/core/jest.shared.config.cjs | 25 ------------------------- packages/core/package.json | 9 +-------- packages/utils/package.json | 1 - pnpm-lock.yaml | 10 ---------- 6 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 packages/core/jest.config.cjs delete mode 100644 packages/core/jest.config.mjs delete mode 100644 packages/core/jest.shared.config.cjs diff --git a/packages/core/jest.config.cjs b/packages/core/jest.config.cjs deleted file mode 100644 index f7c4b88..0000000 --- a/packages/core/jest.config.cjs +++ /dev/null @@ -1,11 +0,0 @@ -const { buildConfiguration } = require('./jest.shared.config.cjs'); - -/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ -module.exports = buildConfiguration({ - moduleFileExtensions: ['ts', 'cjs', 'js'], - globals: { - 'ts-jest': { - useESM: false, - }, - }, -}); diff --git a/packages/core/jest.config.mjs b/packages/core/jest.config.mjs deleted file mode 100644 index aed2d19..0000000 --- a/packages/core/jest.config.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import pkg from './jest.shared.config.cjs'; - -export default pkg.buildConfiguration({ - moduleFileExtensions: ['ts', 'mjs', 'js'], - globals: { - 'ts-jest': { - useESM: true, - }, - }, -}) diff --git a/packages/core/jest.shared.config.cjs b/packages/core/jest.shared.config.cjs deleted file mode 100644 index 26b0961..0000000 --- a/packages/core/jest.shared.config.cjs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Jest shared configuration: see https://jestjs.io/docs/ecmascript-modules. - * - * @param {import('ts-jest/dist/types').InitialOptionsTsJest} configuration - * @return {import('ts-jest/dist/types').InitialOptionsTsJest} - */ -function buildConfiguration(configuration) { - return Object.assign( - {}, - { - verbose: true, - testEnvironment: 'node', - moduleDirectories: ['node_modules', 'src'], - extensionsToTreatAsEsm: ['.ts'], - transform: { - '^.+\\.ts$': 'ts-jest', - }, - testMatch: ['**/tests/**/*-test.ts'], - }, - configuration - ); -} - -exports.buildConfiguration = buildConfiguration; -module.exports = { buildConfiguration }; diff --git a/packages/core/package.json b/packages/core/package.json index c319d6e..e526352 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -17,10 +17,7 @@ "lint": "eslint --fix src/**/*.ts", "prebuild": "pnpm run lint && pnpm run clean", "build": "unbuild", - "test:jest-cjs": "jest --clearCache --config=jest.config.cjs && jest --runInBand --config=jest.config.cjs", - "test:jest-esm": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --clearCache --config=jest.config.mjs && cross-env NODE_OPTIONS=--experimental-vm-modules jest --runInBand --config=jest.config.mjs", - "test": "pnpm run test:jest-cjs && pnpm run test:jest-esm", - "vitest": "vitest --config vitest.config.mjs" + "test": "vitest" }, "sideEffects": false, "exports": { @@ -139,15 +136,11 @@ "@types/jest": "^27.5.2", "@types/node": "^17.0.45", "@typescript-eslint/eslint-plugin": "^5.28.0", - "cross-env": "^7.0.3", "cross-fetch": "^3.1.5", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", - "jest": "28.0.0-alpha.11", "rimraf": "^3.0.2", - "ts-jest": "28.0.0-next.3", - "ts-node": "^10.8.1", "unbuild": "^0.7.4", "vitest": "^0.7.13" } diff --git a/packages/utils/package.json b/packages/utils/package.json index f9837fe..8eab5a1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -226,7 +226,6 @@ "@types/debug": "^4.1.7", "@types/jest": "^27.5.2", "@typescript-eslint/eslint-plugin": "^5.28.0", - "cross-env": "^7.0.3", "eslint": "^8.18.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a941ba4..5f9940e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,6 @@ importers: '@types/debug': ^4.1.7 '@types/jest': ^27.5.2 '@typescript-eslint/eslint-plugin': ^5.28.0 - cross-env: ^7.0.3 debug: ^4.3.4 eslint: ^8.18.0 eslint-config-prettier: ^8.5.0 @@ -36,7 +35,6 @@ importers: '@types/debug': 4.1.7 '@types/jest': 27.5.2 '@typescript-eslint/eslint-plugin': 5.30.5_6zdoc3rn4mpiddqwhppni2mnnm - cross-env: 7.0.3 eslint: 8.19.0 eslint-config-prettier: 8.5.0_eslint@8.19.0 eslint-plugin-prettier: 4.2.1_7uxdfn2xinezdgvmbammh6ev5i @@ -795,14 +793,6 @@ packages: safe-buffer: 5.1.2 dev: true - /cross-env/7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - dependencies: - cross-spawn: 7.0.3 - dev: true - /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'}