2019-10-11 07:35:10 +00:00
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
|
|
|
|
|
|
|
const corePackages = fs.readdirSync(path.resolve(__dirname, 'packages'))
|
|
|
|
|
2018-03-18 23:41:14 +00:00
|
|
|
module.exports = {
|
2018-03-19 15:49:16 +00:00
|
|
|
testEnvironment: 'node',
|
2018-10-17 21:28:25 +00:00
|
|
|
|
2018-07-24 10:12:46 +00:00
|
|
|
expand: true,
|
2018-10-17 21:28:25 +00:00
|
|
|
|
|
|
|
forceExit: true,
|
|
|
|
|
2019-08-25 14:43:18 +00:00
|
|
|
roots: [
|
|
|
|
'<rootDir>/packages',
|
|
|
|
'<rootDir>/test'
|
|
|
|
],
|
|
|
|
|
2018-07-24 10:37:56 +00:00
|
|
|
// https://github.com/facebook/jest/pull/6747 fix warning here
|
2018-08-10 15:55:39 +00:00
|
|
|
// But its performance overhead is pretty bad (30+%).
|
|
|
|
// detectOpenHandles: true
|
2018-10-17 21:28:25 +00:00
|
|
|
|
2019-02-12 13:05:37 +00:00
|
|
|
setupFilesAfterEnv: ['./test/utils/setup'],
|
2018-10-17 21:28:25 +00:00
|
|
|
|
|
|
|
coverageDirectory: './coverage',
|
|
|
|
|
|
|
|
collectCoverageFrom: [
|
2018-10-30 20:42:53 +00:00
|
|
|
'**/packages/*/src/**/*.js'
|
2018-10-17 21:28:25 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
coveragePathIgnorePatterns: [
|
2018-10-30 20:42:53 +00:00
|
|
|
'node_modules/(?!(@nuxt|nuxt))',
|
2019-03-04 20:12:33 +00:00
|
|
|
'packages/webpack/src/config/plugins/vue',
|
|
|
|
'packages/server/src/jsdom'
|
2018-10-17 21:28:25 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
testPathIgnorePatterns: [
|
2018-10-30 20:42:53 +00:00
|
|
|
'node_modules/(?!(@nuxt|nuxt))',
|
2018-10-17 21:28:25 +00:00
|
|
|
'test/fixtures/.*/.*?/',
|
|
|
|
'examples/.*'
|
|
|
|
],
|
|
|
|
|
2018-10-30 20:42:53 +00:00
|
|
|
transformIgnorePatterns: [
|
|
|
|
'node_modules/(?!(@nuxt|nuxt))'
|
|
|
|
],
|
|
|
|
|
2018-10-29 15:48:40 +00:00
|
|
|
transform: {
|
|
|
|
'^.+\\.js$': 'babel-jest',
|
2019-02-12 13:05:37 +00:00
|
|
|
'^.+\\.vue$': 'vue-jest'
|
2018-10-29 15:48:40 +00:00
|
|
|
},
|
|
|
|
|
2018-10-17 21:28:25 +00:00
|
|
|
moduleFileExtensions: [
|
|
|
|
'js',
|
|
|
|
'json'
|
2019-05-25 14:17:21 +00:00
|
|
|
],
|
|
|
|
|
2019-10-11 07:35:10 +00:00
|
|
|
moduleNameMapper: {
|
|
|
|
[`@nuxt/(${corePackages.join('|')})(/?.*)$`]: '<rootDir>/packages/$1/src/$2'
|
|
|
|
},
|
|
|
|
|
2019-05-25 14:17:21 +00:00
|
|
|
reporters: [
|
|
|
|
'default',
|
|
|
|
['jest-junit', { outputDirectory: 'reports/junit' }]
|
2019-02-12 13:05:37 +00:00
|
|
|
]
|
2018-03-18 23:41:14 +00:00
|
|
|
}
|