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');
|
const regeneratorRuntime = require('regenerator-runtime');
|
||||||
|
|
||||||
|
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.(css|less|scss)$': 'identity-obj-proxy',
|
'\\.(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: '.',
|
rootDir: '.',
|
||||||
testRegex: '.*\\.(test|spec)\\.tsx?$',
|
testRegex: '.*\\.(test|spec)\\.tsx?$',
|
||||||
testPathIgnorePatterns: ['/node_modules/'],
|
testPathIgnorePatterns: ['/node_modules/'],
|
||||||
transform: {
|
transform: {
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
|
||||||
'<rootDir>/test/fileTransformer.js',
|
'<rootDir>/test/fileTransformer.js',
|
||||||
|
'^.+\\.jsx?$': 'babel-jest', //这个是jest的默认配置
|
||||||
|
'^.+\\.ts?$': 'ts-jest' //typescript转换
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: ['/node_modules/'],
|
transformIgnorePatterns: ['/node_modules/'],
|
||||||
setupFilesAfterEnv: [],
|
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": {
|
"extends": "../tsconfig.json"
|
||||||
"target": "esnext",
|
|
||||||
"lib": ["DOM"],
|
|
||||||
"jsx": "react",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"typeRoots": ["./node_modules/@types", "../node_modules/@types", "./types"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue