-
Notifications
You must be signed in to change notification settings - Fork 10
/
jest.config.js
44 lines (38 loc) · 1.2 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2017-2021 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0
const config = require('@polkadot/dev/config/jest.cjs');
const findPackages = require('./scripts/findPackages');
const internalModules = findPackages()
.filter(({ name }) => !['@polkadot/apps'].includes(name))
.reduce((modules, { dir, name }) => {
modules[`${name}(.*)$`] = `<rootDir>/packages/${dir}/src/$1`;
return modules;
}, {});
const defaultConfig = {
moduleNameMapper: {
...internalModules,
'@polkadot/apps/(.*)$': '<rootDir>/packages/apps/src/$1',
'\\.(css|less)$': 'empty/object',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object',
'\\.(md)$': '<rootDir>/jest/mocks/empty.js'
},
setupFilesAfterEnv: ['<rootDir>/jest/jest-setup.ts'],
transformIgnorePatterns: [
'<rootDir>/node_modules'
]
};
module.exports = Object.assign({}, config, {
projects: [
{
...defaultConfig,
displayName: 'all-tests',
globalSetup: './jest/globalSetup.ts',
globalTeardown: './jest/globalTeardown.ts'
},
{
...defaultConfig,
displayName: 'fast-tests'
}
],
testTimeout: 25000
});