-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathjest.config.mjs
44 lines (35 loc) · 1.18 KB
/
jest.config.mjs
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
// @ts-check
'use strict';
import { deepMergeConfig } from '@-xun/symbiote/assets';
import {
assertEnvironment,
moduleExport,
transformSelectEsmPackagesToCjs
} from '@-xun/symbiote/assets/jest.config.mjs';
import { createDebugLogger } from 'rejoinder';
const debug = createDebugLogger({ namespace: 'symbiote:config:jest' });
const config = deepMergeConfig(
moduleExport({ derivedAliases: getJestAliases(), ...assertEnvironment() }),
{
// Any custom configs here will be deep merged with moduleExport's result
}
);
transformSelectEsmPackagesToCjs(config, [
'@octokit',
'universal-user-agent',
'before-after-hook'
]);
export default config;
debug('exported config: %O', config);
function getJestAliases() {
// ! These aliases are auto-generated by symbiote. Instead of modifying them
// ! directly, consider regenerating aliases across the entire project with:
// ! `npx symbiote project renovate --regenerate-assets --assets-preset ...`
return {
'^rootverse:(.+)$': '<rootDir>/$1',
'^universe:(.+)$': '<rootDir>/src/$1',
'^universe$': '<rootDir>/src/index.ts',
'^testverse:(.+)$': '<rootDir>/test/$1',
'^typeverse:(.+)$': '<rootDir>/types/$1'
};
}