forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
35 lines (31 loc) · 905 Bytes
/
jest.config.js
File metadata and controls
35 lines (31 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* eslint id-length: ["error", { "exceptions": ["d"] }] */
const fs = require("fs");
const path = require("path");
const root = __dirname;
const moduleDirs = ["node_modules"];
// Add any decidim-*/app/packs directories found in the root
fs.readdirSync(root, { withFileTypes: true }).
filter((d) => d.isDirectory() && (/^decidim-(.*)$/).test(d.name)).
forEach((d) => moduleDirs.push(path.join("<rootDir>", d.name, "app/packs")));
module.exports = {
testEnvironment: "jsdom",
testEnvironmentOptions: {
"url": "https://decidim.dev/"
},
setupFiles: [
"<rootDir>/decidim-core/spec/js/entry_test.js",
"raf/polyfill"
],
moduleFileExtensions: [
"js"
],
moduleNameMapper: {
"\\.(scss|css|less)$": "identity-obj-proxy"
},
transform: {
"\\.yml$": "yaml-jest",
"\\.js$": "babel-jest"
},
testRegex: "\\.(test|spec)\\.js$",
moduleDirectories: moduleDirs
};