Skip to content

Commit 687697d

Browse files
authored
Add Jest test setup for smtp block (#1892)
Part of OPS-3307. ## Additional Notes - Adds a proper Jest testing setup for the smtp block
1 parent a86d5df commit 687697d

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
displayName: 'blocks-smtp',
3+
preset: '../../../jest.preset.js',
4+
setupFiles: ['../../../jest.env.js'],
5+
testEnvironment: 'node',
6+
transform: {
7+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
8+
},
9+
moduleFileExtensions: ['ts', 'js', 'html'],
10+
coverageDirectory: '../../../coverage/packages/blocks/smtp',
11+
};

packages/blocks/smtp/project.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@
2020
"lint": {
2121
"executor": "@nx/eslint:lint",
2222
"outputs": ["{options.outputFile}"]
23+
},
24+
"test": {
25+
"executor": "@nx/jest:jest",
26+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
27+
"options": {
28+
"jestConfig": "packages/blocks/smtp/jest.config.ts",
29+
"passWithNoTests": true
30+
},
31+
"configurations": {
32+
"ci": {
33+
"ci": true,
34+
"codeCoverage": true
35+
}
36+
}
2337
}
2438
},
2539
"tags": []
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"module": "commonjs",
6+
"types": ["jest", "node"]
7+
},
8+
"include": [
9+
"jest.config.ts",
10+
"src/**/*.test.ts",
11+
"src/**/*.spec.ts",
12+
"src/**/*.d.ts"
13+
]
14+
}

0 commit comments

Comments
 (0)