forked from ruilisi/fortune-sheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
31 lines (27 loc) · 966 Bytes
/
jest.config.js
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
const { readdirSync } = require("fs");
const { join } = require("path");
const pkgList = readdirSync(join(__dirname, "./packages")).filter(
(pkg) => pkg.charAt(0) !== "."
);
const moduleNameMapper = {
"\\.(css|less|sass|scss)$": require.resolve("identity-obj-proxy"),
uuid: require.resolve("uuid"),
};
pkgList.forEach((shortName) => {
const name = `@fortune-sheet/${shortName}`;
// Workaround for Jest not having ESM support yet
// See: https://github.com/uuidjs/uuid/issues/451
moduleNameMapper[name] = join(__dirname, `./packages/${shortName}/src`);
});
module.exports = {
collectCoverageFrom: ["packages/**/src/**/*.{ts,tsx}"],
testEnvironment: "jsdom",
moduleNameMapper,
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
transform: {
"\\.(t|j)sx?$": require.resolve("./tests/transformer"),
},
unmockedModulePathPatterns: ["node_modules/react/", "node_modules/enzyme/"],
verbose: true,
setupFiles: ["./tests/setup.js"],
};