2
0
mirror of https://github.com/iconify/iconify.git synced 2024-12-22 09:48:54 +00:00

Remove jest from utils package, use vitest only

This commit is contained in:
Vjacheslav Trushkin 2022-08-21 18:40:56 +03:00
parent 57b8be17ed
commit 6a034033cb
6 changed files with 53 additions and 20131 deletions

View File

@ -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,
},
},
});

View File

@ -1,10 +0,0 @@
import pkg from './jest.shared.config.cjs';
export default pkg.buildConfiguration({
moduleFileExtensions: ['ts', 'mjs', 'js'],
globals: {
'ts-jest': {
useESM: true,
},
},
})

View File

@ -1,26 +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 };

View File

@ -17,12 +17,9 @@
"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:cjs": "vitest --config vitest.config.cjs",
"vitest:esm": "vitest --config vitest.config.mjs",
"vitest": "pnpm run vitest:cjs && pnpm run vitest:esm"
"test:cjs": "vitest --config vitest.config.cjs",
"test:esm": "vitest --config vitest.config.mjs",
"test": "pnpm run test:cjs && pnpm run test:esm"
},
"sideEffects": false,
"main": "lib/index.cjs",
@ -233,10 +230,7 @@
"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",
"typescript": "^4.7.4",
"unbuild": "^0.7.4",
"vitest": "^0.7.13"

View File

@ -1,4 +1,4 @@
import { defineConfig } from 'vitest/config'
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {

File diff suppressed because it is too large Load Diff