diff --git a/packages/foundation/tools/stryker-config/.gitignore b/packages/foundation/tools/stryker-config/.gitignore new file mode 100644 index 00000000..faa9d3db --- /dev/null +++ b/packages/foundation/tools/stryker-config/.gitignore @@ -0,0 +1,5 @@ +# node modules +/node_modules/ + +# Turborepo files +.turbo/ diff --git a/packages/foundation/tools/stryker-config/.lintstagedrc.json b/packages/foundation/tools/stryker-config/.lintstagedrc.json new file mode 100644 index 00000000..6105c241 --- /dev/null +++ b/packages/foundation/tools/stryker-config/.lintstagedrc.json @@ -0,0 +1,5 @@ +{ + "*.js": [ + "prettier --write" + ] +} diff --git a/packages/foundation/tools/stryker-config/lib/index.js b/packages/foundation/tools/stryker-config/lib/index.js new file mode 100644 index 00000000..721ade8b --- /dev/null +++ b/packages/foundation/tools/stryker-config/lib/index.js @@ -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', +}; diff --git a/packages/foundation/tools/stryker-config/package.json b/packages/foundation/tools/stryker-config/package.json new file mode 100644 index 00000000..e8e1a3be --- /dev/null +++ b/packages/foundation/tools/stryker-config/package.json @@ -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" +} diff --git a/packages/foundation/tools/stryker-config/prettier.config.mjs b/packages/foundation/tools/stryker-config/prettier.config.mjs new file mode 100644 index 00000000..70361db5 --- /dev/null +++ b/packages/foundation/tools/stryker-config/prettier.config.mjs @@ -0,0 +1,3 @@ +import config from '@inversifyjs/foundation-prettier-config'; + +export default config;