Skip to content

Commit

Permalink
chore(cdk-plugin): use standalone jest config
Browse files Browse the repository at this point in the history
We cannot migrate this package to vitest yet, until the following
issue is resolved:
vitest-dev/vitest#1436
  • Loading branch information
adriencaccia committed Sep 10, 2022
1 parent 7b51d58 commit dbd8721
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
21 changes: 19 additions & 2 deletions packages/serverless-cdk-plugin/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import { jestConfig } from '@swarmion/configuration';
import type { InitialOptionsTsJest } from 'ts-jest/dist/types';

export default { ...jestConfig, testTimeout: 10000 };
const TEST_REGEX = '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?|tsx?|ts?)$';

const config: InitialOptionsTsJest = {
preset: 'ts-jest',
testRegex: TEST_REGEX,
globals: {
'ts-jest': {
isolatedModules: true,
},
},
testEnvironment: 'node',
coverageReporters: ['json', ['lcov', { projectRoot: './' }]],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
moduleDirectories: ['node_modules', '<rootDir>/src'],
testTimeout: 10000,
};

export default config;
3 changes: 2 additions & 1 deletion packages/serverless-cdk-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@babel/preset-env": "^7.18.9",
"@babel/preset-typescript": "^7.18.6",
"@serverless/test": "^11.0.1",
"@swarmion/configuration": "^0.9.6",
"@types/jest": "^28.1.6",
"@types/node": "^18.6.3",
"@zerollup/ts-transform-paths": "^1.7.18",
"aws-cdk-lib": "^2.34.2",
Expand All @@ -63,6 +63,7 @@
"json-schema-to-ts": "^2.5.4",
"prettier": "^2.7.1",
"serverless": "^3.21.0",
"ts-jest": "^27.1.5",
"ts-node": "^10.9.1",
"ttypescript": "^1.5.13",
"typescript": "^4.7.4"
Expand Down
1 change: 1 addition & 0 deletions packages/serverless-cdk-plugin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"],
"baseUrl": "src",
"composite": true,
"plugins": [
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4863,7 +4863,7 @@ __metadata:
"@babel/runtime": ^7.18.9
"@serverless/test": ^11.0.1
"@serverless/typescript": ^3.21.0
"@swarmion/configuration": ^0.9.6
"@types/jest": ^28.1.6
"@types/node": ^18.6.3
"@zerollup/ts-transform-paths": ^1.7.18
aws-cdk-lib: ^2.34.2
Expand All @@ -4877,6 +4877,7 @@ __metadata:
lodash: ^4.17.21
prettier: ^2.7.1
serverless: ^3.21.0
ts-jest: ^27.1.5
ts-node: ^10.9.1
ts-toolbelt: ^9.6.0
ttypescript: ^1.5.13
Expand Down

0 comments on commit dbd8721

Please sign in to comment.