Open History to see the last commit
1const path = require('path')
2const { lstatSync, readdirSync } = require('fs')
3β
4// get listing of packages in the mono repo
5const basePath = path.resolve(__dirname, 'packages')
6const packages = readdirSync(basePath)
7 .filter((name) => {
8 return lstatSync(path.join(basePath, name)).isDirectory()
9 })
10 .sort((a, b) => b.length - a.length)
11β
12const { namespace } = require('./package.json')
13β
14const moduleNameMapper = {
15 ...packages.reduce(
16 (acc, name) => ({
17 ...acc,
18 [`${namespace}/${name}(.*)$`]: `<rootDir>/../../packages/./${name}/src/$1`,
19 }),
20 {},
21 ),
22}
23β
24module.exports = {
25 collectCoverage: true,
26 coverageReporters: ['json', 'lcov', 'text', 'clover', 'text-summary'],
27 testMatch: ['<rootDir>/**/src/**/*.test.[jt]s?(x)'],
28 transform: { '^.+\\.(ts|tsx)$': 'ts-jest' },
29 clearMocks: true,
30 testEnvironment: 'jsdom',
31 snapshotFormat: {
32 printBasicPrototype: false,
33 },
34 globals: {
35 'ts-jest': {
36 isolatedModules: true,
37 diagnostics: {
38 exclude: ['**'],
39 },
40 },
41 },
42 moduleNameMapper,
43}