19 Star 79 Fork 32

Gitee 极速下载/OverVue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/TeamOverVue/OverVue
克隆/下载
jest.config.js 2.39 KB
一键复制 编辑 原始数据 按行查看 历史
Roderick de Leon 提交于 2024-03-26 12:36 . createBoilerFunc update
const esModules = ['quasar', 'quasar/lang', 'lodash-es'].join('|');
module.exports = {
testEnvironment: "jsdom",
verbose: true,
globals: {
__DEV__: true,
// TODO: Remove if resolved natively
// See https://github.com/vuejs/vue-jest/issues/175
'vue-jest': {
pug: { doctype: 'html' },
}
},
modulePaths: [ "<rootDir>", "/home/some/other/path" ],
moduleDirectories: [ "node_modules" ],
testEnvironmentOptions: {
customExportConditions: ["node", "node-addons"],
},
// noStackTrace: true,
// bail: true,
// cache: false,
// verbose: true,
// watch: true,
collectCoverage: false,
coverageDirectory: '<rootDir>/test/jest/coverage',
collectCoverageFrom: [
'<rootDir>/src/**/*.vue',
'<rootDir>/src/**/*.js',
'<rootDir>/src/**/*.jsx',
],
// Needed in JS codebases too because of feature flags
coveragePathIgnorePatterns: ['/node_modules/', '.d.ts$'],
coverageThreshold: {
global: {
// branches: 50,
// functions: 50,
// lines: 50,
// statements: 50
},
},
testMatch: [
'<rootDir>/test/jest/__tests__/**/*.(spec|test).js',
'<rootDir>/src/**/*.jest.(spec|test).js',
],
moduleFileExtensions: ['vue', 'js', 'jsx', 'json', 'ts'],
moduleNameMapper: {
'^quasar$': 'quasar/dist/quasar.esm.prod.js',
'^~/(.*)$': '<rootDir>/$1',
'^src/(.*)$': '<rootDir>/src/$1',
'^app/(.*)$': '<rootDir>/$1',
'^components/(.*)$': '<rootDir>/src/components/$1',
'^layouts/(.*)$': '<rootDir>/src/layouts/$1',
'^pages/(.*)$': '<rootDir>/src/pages/$1',
'^assets/(.*)$': '<rootDir>/src/assets/$1',
'^boot/(.*)$': '<rootDir>/src/boot/$1',
'\\.(css)$': '<rootDir>/__mocks__/styleMock.js',
'^@/(.*)$': '<rootDir>/src/$1',
},
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest',
// '^.+\\.(js|jsx)$": "babel-jest',
// '.*\\.vue$': 'vue-jest',
'.*\\.vue$': '@vue/vue3-jest',
'.*\\.js$': 'babel-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
// use these if NPM is being flaky, care as hosting could interfere with these
// '.*\\.vue$': '@quasar/quasar-app-extension-testing-unit-jest/node_modules/vue-jest',
// '.*\\.js$': '@quasar/quasar-app-extension-testing-unit-jest/node_modules/babel-jest'
},
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
snapshotSerializers: ['jest-serializer-vue'],
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/OverVue.git
[email protected]:mirrors/OverVue.git
mirrors
OverVue
OverVue
master

搜索帮助