2023-09-04 17:13:32 +00:00
|
|
|
'use strict';
|
|
|
|
|
2022-01-26 22:10:35 +00:00
|
|
|
// For a detailed explanation regarding each configuration property, visit:
|
|
|
|
// https://jestjs.io/docs/en/configuration.html
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
moduleNameMapper: {
|
2023-10-02 20:54:55 +00:00
|
|
|
'@wikimedia/codex-search': '@wikimedia/codex',
|
2022-08-15 16:34:28 +00:00
|
|
|
'^./templates/(.*).mustache': '<rootDir>/includes/templates/$1.mustache'
|
2022-01-26 22:10:35 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
// Automatically clear mock calls and instances between every test
|
|
|
|
clearMocks: true,
|
|
|
|
|
|
|
|
// Indicates whether the coverage information should be collected while executing the test
|
|
|
|
collectCoverage: true,
|
|
|
|
|
|
|
|
// An array of glob patterns indicating a set of files fo
|
|
|
|
// which coverage information should be collected
|
|
|
|
collectCoverageFrom: [
|
|
|
|
'resources/**/*.(js|vue)'
|
|
|
|
],
|
|
|
|
|
|
|
|
// The directory where Jest should output its coverage files
|
|
|
|
coverageDirectory: 'coverage',
|
|
|
|
|
|
|
|
// An array of regexp pattern strings used to skip coverage collection
|
|
|
|
coveragePathIgnorePatterns: [
|
2024-09-06 16:32:29 +00:00
|
|
|
'/node_modules/'
|
2022-01-26 22:10:35 +00:00
|
|
|
],
|
|
|
|
|
|
|
|
// An object that configures minimum threshold enforcement for coverage results
|
|
|
|
coverageThreshold: {
|
|
|
|
global: {
|
2024-01-18 00:59:41 +00:00
|
|
|
branches: 35,
|
|
|
|
functions: 45,
|
|
|
|
lines: 48,
|
|
|
|
statements: 48
|
2022-01-26 22:10:35 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// An array of file extensions your modules use
|
|
|
|
moduleFileExtensions: [
|
|
|
|
'js',
|
|
|
|
'json',
|
|
|
|
'vue'
|
|
|
|
],
|
|
|
|
|
2023-11-20 22:55:41 +00:00
|
|
|
modulePathIgnorePatterns: [
|
|
|
|
'<rootDir>/tests/integration-qunit/'
|
|
|
|
],
|
|
|
|
|
2022-01-26 22:10:35 +00:00
|
|
|
// The paths to modules that run some code to configure or
|
|
|
|
// set up the testing environment before each test
|
|
|
|
setupFiles: [
|
|
|
|
'./jest.setup.js'
|
|
|
|
],
|
|
|
|
|
2022-02-01 20:52:16 +00:00
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
|
2022-01-26 22:10:35 +00:00
|
|
|
transform: {
|
2022-08-15 16:34:28 +00:00
|
|
|
'^.+\\.mustache?$': 'mustache-jest',
|
2022-02-01 20:52:16 +00:00
|
|
|
'.*\\.(vue)$': '<rootDir>/node_modules/@vue/vue3-jest'
|
2022-01-26 22:10:35 +00:00
|
|
|
}
|
|
|
|
};
|