forked from Shopify/shopify-app-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loom.config.ts
36 lines (33 loc) · 1.04 KB
/
loom.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
import {createWorkspace, createWorkspacePlugin} from '@shopify/loom';
import {buildLibraryWorkspace} from '@shopify/loom-plugin-build-library';
import {eslint} from '@shopify/loom-plugin-eslint';
import {prettier} from '@shopify/loom-plugin-prettier';
import type {} from '@shopify/loom-plugin-jest';
export default createWorkspace((workspace) => {
workspace.use(
buildLibraryWorkspace(),
eslint(),
prettier({files: '**/*.{json,md}'}),
jestWorkspaceConfigPlugin(),
);
});
function jestWorkspaceConfigPlugin() {
return createWorkspacePlugin(
'shopify-app-js--workplace-setup',
({tasks: {test}}) => {
test.hook(({hooks}) => {
hooks.configure.hook((configure) => {
configure.jestSetupFilesAfterEnv?.hook((files) => [
...files,
'../../tests/setup/setup-jest.ts',
]);
// Increase the test timeout to 20 seconds
configure.jestConfig?.hook((config) => ({
...config,
testTimeout: 30000,
}));
});
});
},
);
}