Skip to content

Commit

Permalink
Merge pull request #29 from inversify/chore/add-stryker-config
Browse files Browse the repository at this point in the history
Add stryker config
  • Loading branch information
notaphplover authored Oct 18, 2024
2 parents 032c83c + 1dab4fb commit 1420d0b
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/collect-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
uses: codecov/codecov-action@v4
with:
flags: ${{ matrix.package }}
override_branch: main
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

test-coverage:
name: Test with coverage
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"commit": "commit",
"format": "turbo run format",
"lint": "turbo run lint",
"prepare": "husky",
"prepare": "husky && turbo telemetry disable",
"prerelease": "pnpm run build",
"release": "changeset publish",
"test:integration:js": "turbo test:integration:js",
Expand Down
6 changes: 3 additions & 3 deletions packages/foundation/tools/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "Common scripts for monorepo packages",
"repository": {
"type": "git",
"url": "git+https://github.com/notaphplover/one-game.git"
"url": "git+https://github.com/inversify/monorepo.git"
},
"author": "Multiple authors",
"license": "MIT",
"bugs": {
"url": "https://github.com/notaphplover/one-game/issues"
"url": "https://github.com/inversify/monorepo/issues"
},
"type": "module",
"homepage": "https://github.com/notaphplover/one-game#readme",
"homepage": "https://github.com/inversify/monorepo#readme",
"bin": {
"foundation-get-affected-projects": "./bin/getAffectedProjects.js",
"foundation-get-affected-project-chunks": "./bin/getAffectedProjectsChunks.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/foundation/tools/stryker-config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# node modules
/node_modules/

# Turborepo files
.turbo/
5 changes: 5 additions & 0 deletions packages/foundation/tools/stryker-config/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.js": [
"prettier --write"
]
}
33 changes: 33 additions & 0 deletions packages/foundation/tools/stryker-config/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// @ts-check
/**
* @type {import('@stryker-mutator/api/core').PartialStrykerOptions}
*/
export default {
checkers: ['typescript'],
cleanTempDir: 'always',
concurrency: 1,
coverageAnalysis: 'perTest',
disableTypeChecks: 'src/**/*.ts',
jest: {
configFile: './jest.config.stryker.mjs',
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',
],
packageManager: 'pnpm',
plugins: [
'@stryker-mutator/jest-runner',
'@stryker-mutator/typescript-checker',
],
tempDirName: 'stryker-tmp',
testRunner: 'jest',
tsconfigFile: './tsconfig.json',
};
23 changes: 23 additions & 0 deletions packages/foundation/tools/stryker-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"author": "Roberto Pintos López",
"bugs": {
"url": "https://github.com/inversify/monorepo/issues"
},
"description": "Stryker config for monorepo packages",
"devDependencies": {
"@stryker-mutator/api": "8.6.0"
},
"exports": "./lib/index.js",
"homepage": "https://github.com/inversify/monorepo#readme",
"license": "MIT",
"name": "@cornie-js/backend-stryker-config",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/inversify/monorepo.git"
},
"scripts": {
"format": "prettier --write ./lib/**/*.js"
},
"type": "module"
}
3 changes: 3 additions & 0 deletions packages/foundation/tools/stryker-config/prettier.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@inversifyjs/foundation-prettier-config';

export default config;

0 comments on commit 1420d0b

Please sign in to comment.