forked from Shopify/polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sewing-kit.config.ts
38 lines (32 loc) · 1008 Bytes
/
sewing-kit.config.ts
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
import {join} from 'path';
import {ConfigurationCallback, Env, Plugins} from '@shopify/sewing-kit';
const tests = join(__dirname, 'tests');
interface InitialOptions extends jest.InitialOptions {
setupFilesAfterEnv: string[];
}
// eslint-disable-next-line import/no-default-export
export default function sewingKitConfig(
plugins: Plugins,
env: Env,
): ReturnType<ConfigurationCallback> {
return {
name: 'polaris',
library: true,
plugins: [
plugins.jest((config: InitialOptions) => {
config.roots = [join(__dirname, 'src'), join(__dirname, 'tests')];
config.setupFiles.push(join(tests, 'setup.ts'));
config.setupFilesAfterEnv = [join(tests, 'each-test.ts')];
// Code coverage
config.collectCoverageFrom = [
'src/**/*.{ts,tsx}',
'!src/test-utilities/**/*.*',
'!src/**/index.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.test.{ts,tsx}',
];
return config;
}),
],
};
}