mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor: fix tests
This commit is contained in:
parent
d29dde828e
commit
1a4101ca81
5 changed files with 20 additions and 11 deletions
|
@ -1,7 +1,11 @@
|
|||
import { merge, Config } from '@silverhand/jest-config';
|
||||
import type { Config } from '@silverhand/jest-config';
|
||||
import { merge } from '@silverhand/jest-config';
|
||||
|
||||
const config: Config.InitialOptions = merge({
|
||||
roots: ['./src'],
|
||||
moduleNameMapper: {
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
},
|
||||
});
|
||||
|
||||
export default config;
|
||||
|
|
|
@ -2,19 +2,12 @@ import type { Config } from '@silverhand/jest-config';
|
|||
import { merge } from '@silverhand/jest-config';
|
||||
|
||||
const config: Config.InitialOptions = merge({
|
||||
preset: 'ts-jest/presets/js-with-ts-esm',
|
||||
testPathIgnorePatterns: ['/core/connectors/'],
|
||||
setupFilesAfterEnv: ['jest-matcher-specific-error', './jest.setup.ts'],
|
||||
moduleNameMapper: {
|
||||
'^#src/(.*)\\.js(x)?$': '<rootDir>/src/$1',
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
},
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
useESM: true,
|
||||
},
|
||||
},
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
});
|
||||
|
||||
export default config;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
"license": "MPL-2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"precommit": "lint-staged",
|
||||
"start": "parcel src/index.html",
|
||||
"dev": "cross-env PORT=5003 parcel src/index.html --public-url /demo-app --no-cache --hmr-port 6003",
|
||||
|
|
|
@ -1 +1,10 @@
|
|||
export { default } from '@silverhand/jest-config';
|
||||
import type { Config } from '@silverhand/jest-config';
|
||||
import { merge } from '@silverhand/jest-config';
|
||||
|
||||
const config: Config.InitialOptions = merge({
|
||||
moduleNameMapper: {
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
},
|
||||
});
|
||||
|
||||
export default config;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import { merge, Config } from '@silverhand/jest-config';
|
||||
import type { Config } from '@silverhand/jest-config';
|
||||
import { merge } from '@silverhand/jest-config';
|
||||
|
||||
const config: Config.InitialOptions = merge({
|
||||
roots: ['./src'],
|
||||
moduleNameMapper: {
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
},
|
||||
});
|
||||
|
||||
export default config;
|
||||
|
|
Loading…
Reference in a new issue