mirror of https://github.com/msgbyte/tailchat
test: global test
parent
ea940bdb27
commit
e73139a476
@ -1,19 +1,21 @@
|
||||
const { compilerOptions } = require('./tsconfig');
|
||||
const regeneratorRuntime = require('regenerator-runtime');
|
||||
|
||||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'jsdom',
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less|scss)$': 'identity-obj-proxy',
|
||||
},
|
||||
// projects: ['<rootDir>', '<rootDir>/web/*'], // https://jestjs.io/docs/next/configuration#projects-arraystring--projectconfig
|
||||
// projects: ['<rootDir>/web/'], // https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
|
||||
rootDir: '.',
|
||||
testRegex: '.*\\.(test|spec)\\.tsx?$',
|
||||
testPathIgnorePatterns: ['/node_modules/'],
|
||||
transform: {
|
||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||
'<rootDir>/test/fileTransformer.js',
|
||||
'^.+\\.jsx?$': 'babel-jest', //这个是jest的默认配置
|
||||
'^.+\\.ts?$': 'ts-jest' //typescript转换
|
||||
},
|
||||
transformIgnorePatterns: ['/node_modules/'],
|
||||
setupFilesAfterEnv: [],
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"lib": ["DOM"],
|
||||
"jsx": "react",
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"typeRoots": ["./node_modules/@types", "../node_modules/@types", "./types"]
|
||||
}
|
||||
}
|
@ -1,12 +1,3 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"lib": ["DOM"],
|
||||
"jsx": "react",
|
||||
"esModuleInterop": true,
|
||||
"isolatedModules": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"typeRoots": ["./node_modules/@types", "../node_modules/@types", "./types"]
|
||||
}
|
||||
"extends": "../tsconfig.json"
|
||||
}
|
||||
|
Loading…
Reference in New Issue