|
|
@@ -14,10 +14,22 @@ module.exports = {
|
|
|
|
|
|
preset: 'ts-jest/presets/js-with-ts',
|
|
|
|
|
|
- globalSetup: '<rootDir>/src/test/global-setup.js',
|
|
|
- globalTeardown: '<rootDir>/src/test/global-teardown.js',
|
|
|
-
|
|
|
projects: [
|
|
|
+ {
|
|
|
+ displayName: 'unit',
|
|
|
+
|
|
|
+ preset: 'ts-jest/presets/js-with-ts',
|
|
|
+
|
|
|
+ rootDir: '.',
|
|
|
+ roots: ['<rootDir>/src'],
|
|
|
+ testMatch: ['<rootDir>/src/test/unit/**/*.test.ts', '<rootDir>/src/test/unit/**/*.test.js'],
|
|
|
+
|
|
|
+ testEnvironment: 'node',
|
|
|
+
|
|
|
+ // Automatically clear mock calls and instances between every test
|
|
|
+ clearMocks: true,
|
|
|
+ moduleNameMapper: MODULE_NAME_MAPPING,
|
|
|
+ },
|
|
|
{
|
|
|
displayName: 'server',
|
|
|
|
|
|
@@ -25,9 +37,13 @@ module.exports = {
|
|
|
|
|
|
rootDir: '.',
|
|
|
roots: ['<rootDir>/src'],
|
|
|
+ testMatch: ['<rootDir>/src/test/integration/**/*.test.ts', '<rootDir>/src/test/integration/**/*.test.js'],
|
|
|
+
|
|
|
testEnvironment: 'node',
|
|
|
- setupFilesAfterEnv: ['<rootDir>/src/test/setup.js'],
|
|
|
- testMatch: ['<rootDir>/src/test/**/*.test.ts', '<rootDir>/src/test/**/*.test.js'],
|
|
|
+ globalSetup: '<rootDir>/src/test/integration/global-setup.js',
|
|
|
+ globalTeardown: '<rootDir>/src/test/integration/global-teardown.js',
|
|
|
+ setupFilesAfterEnv: ['<rootDir>/src/test/integration/setup.js'],
|
|
|
+
|
|
|
// Automatically clear mock calls and instances between every test
|
|
|
clearMocks: true,
|
|
|
moduleNameMapper: MODULE_NAME_MAPPING,
|