Skip to content

Commit

Permalink
Merge pull request #34 from inversify/chore/add-test-mutation-reports
Browse files Browse the repository at this point in the history
Add test mutation reports
  • Loading branch information
notaphplover authored Oct 19, 2024
2 parents 1c6ef29 + a9fd02c commit 27a1e7d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@inversifyjs/foundation-eslint-config": "workspace:*",
"@inversifyjs/foundation-jest-config": "workspace:*",
"@inversifyjs/foundation-scripts": "workspace:*",
"@inversifyjs/foundation-stryker-config": "workspace:*",
"@inversifyjs/foundation-typescript-config": "workspace:*",
"husky": "9.1.6",
"lint-staged": "15.2.10",
Expand Down
3 changes: 3 additions & 0 deletions packages/container/libraries/common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Test coverage report
/coverage

# Test mutation report
/reports

# node modules
/node_modules/

Expand Down
9 changes: 9 additions & 0 deletions packages/container/libraries/common/jest.config.stryker.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { getJestTsProjectConfig } from '@inversifyjs/foundation-jest-config';

const tsGlobalConfig = getJestTsProjectConfig(
'All',
['/node_modules', '.int.spec.ts'],
'.spec.ts',
);

export default tsGlobalConfig;
4 changes: 4 additions & 0 deletions packages/container/libraries/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"devDependencies": {
"@eslint/js": "9.13.0",
"@jest/globals": "29.7.0",
"@stryker-mutator/core": "8.6.0",
"@stryker-mutator/jest-runner": "8.6.0",
"@stryker-mutator/typescript-checker": "8.6.0",
"@types/node": "20.16.13",
"@typescript-eslint/eslint-plugin": "8.10.0",
"@typescript-eslint/parser": "8.10.0",
Expand Down Expand Up @@ -56,6 +59,7 @@
"test:integration:js": "pnpm run test:js --selectProjects Integration",
"test:js": "jest --config=jest.js.config.mjs --runInBand",
"test:js:coverage": "pnpm run test:unit:js --coverage",
"test:mutation": "stryker run",
"test:uncommitted": "pnpm run test --changedSince=HEAD",
"test:unit:js": "pnpm run test:js --selectProjects Unit"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/container/libraries/common/stryker.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@inversifyjs/foundation-stryker-config';

export default config;
10 changes: 1 addition & 9 deletions packages/foundation/tools/stryker-config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ export default {
enableFindRelatedTests: true,
projectType: 'custom',
},
mutate: [
'src/**/*.ts',
'!src/**/*.spec.ts',
'!src/**/*{Fixtures,Mocks}.ts',
'!src/**/adapter/nest/modules/*.ts',
'!src/**/adapter/typeorm/migrations/*.ts',
'!src/**/adapter/typeorm/scripts/*.ts',
'!src/**/application/controllers/*.ts',
],
mutate: ['src/**/*.ts', '!src/**/*.spec.ts', '!src/**/*{Fixtures,Mocks}.ts'],
packageManager: 'pnpm',
plugins: [
'@stryker-mutator/jest-runner',
Expand Down
2 changes: 1 addition & 1 deletion packages/foundation/tools/stryker-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"exports": "./lib/index.js",
"homepage": "https://github.com/inversify/monorepo#readme",
"license": "MIT",
"name": "@cornie-js/backend-stryker-config",
"name": "@inversifyjs/foundation-stryker-config",
"private": true,
"repository": {
"type": "git",
Expand Down

0 comments on commit 27a1e7d

Please sign in to comment.