-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
43 lines (40 loc) · 1.36 KB
/
Copy pathjest.config.js
File metadata and controls
43 lines (40 loc) · 1.36 KB
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
// Copyright (c) 2023-2024. Heusala Group Oy <info@hg.fi>. All rights reserved.
/**
* The scope of tests to perform.
*
* 2. `unit`: Unit tests for Hyperify.io project
* 3. `system`: Full system tests which require real running system
* 4. `integration`: There is also a special scope "integration" which will enable MySQL and PostgreSQL
* integration tests against a full server. To run these, you need to install
* `mysql` and/or `pg` NPM modules and provide configuration parameters.
*
* @type {string[]}
*/
const TEST_SCOPES = (process.env.TEST_SCOPES??'unit,system').split(/[ ,|;:\t]+/).map(item => item.toLowerCase());
/**
* The default timeout of the tests
*
* @type {number}
*/
const TEST_TIMEOUT = parseInt(process.env.TEST_TIMEOUT ?? '300000', 10);
/** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
projects: [
...(TEST_SCOPES.includes('unit') || TEST_SCOPES.includes('integration') ? [
"./src/io/hyperify/core",
"./src/io/hyperify/node",
"./src/io/hyperify/frontend",
"./src/io/hyperify/mysql",
"./src/io/hyperify/pg",
]: [])
],
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/node_modules/**',
],
coverageDirectory: './coverage',
testTimeout: TEST_TIMEOUT,
setupFilesAfterEnv: [
"./src/io/hyperify/testing/jest/matchers/index.ts"
]
};