0
Fork 0
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:
Gao Sun 2022-11-21 16:48:33 +08:00
parent d29dde828e
commit 1a4101ca81
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
5 changed files with 20 additions and 11 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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",

View file

@ -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;

View file

@ -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;