Zoupers
6 months ago
5 changed files with 140 additions and 64 deletions
@ -0,0 +1,51 @@
|
||||
import type { Config } from "jest"; |
||||
// import webpackConfig from "./webpack/webpack.dev";
|
||||
|
||||
export default { |
||||
// testEnvironment: "<rootDir>/test/testEnvironmentJsdom.ts",
|
||||
testEnvironment: "jsdom", |
||||
testEnvironmentOptions: { |
||||
// html: fs.readFileSync(path.join(__dirname, "test/index.html")),
|
||||
}, |
||||
testMatch: ["<rootDir>/src/**/*.test.js"], |
||||
collectCoverage: false, |
||||
collectCoverageFrom: ["src/**/*.js", "!src/**/*.test.js"], |
||||
coverageDirectory: "coverage", |
||||
coverageReporters: ["html", "json-summary", "cobertura"], |
||||
|
||||
reporters: [ |
||||
"default", |
||||
[ |
||||
"jest-html-reporters", |
||||
{ |
||||
publicPath: "./html-report", |
||||
openReport: true, |
||||
}, |
||||
], |
||||
], |
||||
|
||||
transform: { |
||||
"^.+\\.jsx?$": "babel-jest", |
||||
"^.+\\.tsx?$": "babel-jest", |
||||
}, |
||||
|
||||
preset: "jest-puppeteer", |
||||
verbose: true, |
||||
watchman: true, |
||||
injectGlobals: true, |
||||
globals: { |
||||
"ts-jest": { |
||||
tsconfig: "tsconfig.json", |
||||
}, |
||||
}, |
||||
setupFilesAfterEnv: [ |
||||
"<rootDir>/src/bundle.js", |
||||
"<rootDir>/src/core/platform/web/config.js", |
||||
"<rootDir>/../demo/i18n/i18n.cn.js", |
||||
"<rootDir>/test/utils.js", |
||||
"<rootDir>/test/prepare.js", |
||||
], |
||||
moduleNameMapper: { |
||||
"@/(.*)$": "<rootDir>/src/$1", |
||||
}, |
||||
} as Config; |
Loading…
Reference in new issue