mirror of
https://github.com/iconify/iconify.git
synced 2024-11-09 14:50:56 +00:00
test: add vitest cjs
This commit is contained in:
parent
9071d0aeaa
commit
ad0e490b91
@ -1,16 +1,6 @@
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
/*
|
||||
module.exports = {
|
||||
verbose: true,
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**!/tests/!*-test.ts'],
|
||||
};
|
||||
*/
|
||||
|
||||
const { buildConfiguration } = require('./jest.shared.config.cjs');
|
||||
|
||||
/** @type {() => typeof import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
module.exports = buildConfiguration({
|
||||
moduleFileExtensions: ['ts', 'cjs', 'js'],
|
||||
globals: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// see https://jestjs.io/docs/ecmascript-modules
|
||||
|
||||
/** @type {() => typeof import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
/** @type {() => import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
/** @return {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
const buildConfiguration = (configuration) => {
|
||||
return Object.assign({}, {
|
||||
|
@ -24,7 +24,9 @@
|
||||
"test:jest-cjs": "npm run build-dual && jest --clearCache && jest --config=jest.config.cjs",
|
||||
"test:jest-esm": "npm run build-dual && jest --clearCache && cross-env NODE_OPTIONS=--experimental-vm-modules npx jest --config=jest.config.mjs",
|
||||
"test-dual": "npm run test:jest-esm && npm run test:jest-cjs && npm run test:jasmine",
|
||||
"vitest": "vitest"
|
||||
"vitest:cjs": "vitest --config vitest.config.cjs",
|
||||
"vitest:esm": "vitest --config vitest.config.mjs",
|
||||
"vitest": "npm run vitest:cjs && npm run vitest:esm"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
|
13
packages/utils/vitest.config.cjs
Normal file
13
packages/utils/vitest.config.cjs
Normal file
@ -0,0 +1,13 @@
|
||||
const { defineConfig } = require('vitest/config');
|
||||
|
||||
module.exports = defineConfig({
|
||||
resolve: {
|
||||
mainFields: ['require'],
|
||||
extensions: ['.cjs'],
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
watch: false,
|
||||
include: ['**/tests/*-test.ts'],
|
||||
},
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
Loading…
Reference in New Issue
Block a user