@d-es-ign/stryker-js-core 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +96 -0
- package/bin/stryker +2 -0
- package/bin/stryker.js +6 -0
- package/dist/src/checker/checker-child-process-proxy.d.ts +16 -0
- package/dist/src/checker/checker-child-process-proxy.d.ts.map +1 -0
- package/dist/src/checker/checker-child-process-proxy.js +22 -0
- package/dist/src/checker/checker-child-process-proxy.js.map +1 -0
- package/dist/src/checker/checker-facade.d.ts +9 -0
- package/dist/src/checker/checker-facade.d.ts.map +1 -0
- package/dist/src/checker/checker-facade.js +52 -0
- package/dist/src/checker/checker-facade.js.map +1 -0
- package/dist/src/checker/checker-factory.d.ts +10 -0
- package/dist/src/checker/checker-factory.d.ts.map +1 -0
- package/dist/src/checker/checker-factory.js +10 -0
- package/dist/src/checker/checker-factory.js.map +1 -0
- package/dist/src/checker/checker-resource.d.ts +8 -0
- package/dist/src/checker/checker-resource.d.ts.map +1 -0
- package/dist/src/checker/checker-resource.js +2 -0
- package/dist/src/checker/checker-resource.js.map +1 -0
- package/dist/src/checker/checker-retry-decorator.d.ts +12 -0
- package/dist/src/checker/checker-retry-decorator.d.ts.map +1 -0
- package/dist/src/checker/checker-retry-decorator.js +37 -0
- package/dist/src/checker/checker-retry-decorator.js.map +1 -0
- package/dist/src/checker/checker-worker.d.ts +14 -0
- package/dist/src/checker/checker-worker.d.ts.map +1 -0
- package/dist/src/checker/checker-worker.js +41 -0
- package/dist/src/checker/checker-worker.js.map +1 -0
- package/dist/src/checker/index.d.ts +4 -0
- package/dist/src/checker/index.d.ts.map +1 -0
- package/dist/src/checker/index.js +4 -0
- package/dist/src/checker/index.js.map +1 -0
- package/dist/src/child-proxy/child-process-crashed-error.d.ts +8 -0
- package/dist/src/child-proxy/child-process-crashed-error.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-crashed-error.js +16 -0
- package/dist/src/child-proxy/child-process-crashed-error.js.map +1 -0
- package/dist/src/child-proxy/child-process-proxy-worker.d.ts +32 -0
- package/dist/src/child-proxy/child-process-proxy-worker.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-proxy-worker.js +148 -0
- package/dist/src/child-proxy/child-process-proxy-worker.js.map +1 -0
- package/dist/src/child-proxy/child-process-proxy.d.ts +45 -0
- package/dist/src/child-proxy/child-process-proxy.d.ts.map +1 -0
- package/dist/src/child-proxy/child-process-proxy.js +232 -0
- package/dist/src/child-proxy/child-process-proxy.js.map +1 -0
- package/dist/src/child-proxy/id-generator.d.ts +5 -0
- package/dist/src/child-proxy/id-generator.d.ts.map +1 -0
- package/dist/src/child-proxy/id-generator.js +7 -0
- package/dist/src/child-proxy/id-generator.js.map +1 -0
- package/dist/src/child-proxy/message-protocol.d.ts +71 -0
- package/dist/src/child-proxy/message-protocol.d.ts.map +1 -0
- package/dist/src/child-proxy/message-protocol.js +34 -0
- package/dist/src/child-proxy/message-protocol.js.map +1 -0
- package/dist/src/child-proxy/out-of-memory-error.d.ts +5 -0
- package/dist/src/child-proxy/out-of-memory-error.d.ts.map +1 -0
- package/dist/src/child-proxy/out-of-memory-error.js +11 -0
- package/dist/src/child-proxy/out-of-memory-error.js.map +1 -0
- package/dist/src/concurrent/concurrency-token-provider.d.ts +20 -0
- package/dist/src/concurrent/concurrency-token-provider.d.ts.map +1 -0
- package/dist/src/concurrent/concurrency-token-provider.js +68 -0
- package/dist/src/concurrent/concurrency-token-provider.js.map +1 -0
- package/dist/src/concurrent/index.d.ts +4 -0
- package/dist/src/concurrent/index.d.ts.map +1 -0
- package/dist/src/concurrent/index.js +4 -0
- package/dist/src/concurrent/index.js.map +1 -0
- package/dist/src/concurrent/pool.d.ts +49 -0
- package/dist/src/concurrent/pool.d.ts.map +1 -0
- package/dist/src/concurrent/pool.js +137 -0
- package/dist/src/concurrent/pool.js.map +1 -0
- package/dist/src/concurrent/resource-decorator.d.ts +14 -0
- package/dist/src/concurrent/resource-decorator.d.ts.map +1 -0
- package/dist/src/concurrent/resource-decorator.js +24 -0
- package/dist/src/concurrent/resource-decorator.js.map +1 -0
- package/dist/src/config/config-file-formats.d.ts +6 -0
- package/dist/src/config/config-file-formats.d.ts.map +1 -0
- package/dist/src/config/config-file-formats.js +23 -0
- package/dist/src/config/config-file-formats.js.map +1 -0
- package/dist/src/config/config-reader.d.ts +23 -0
- package/dist/src/config/config-reader.d.ts.map +1 -0
- package/dist/src/config/config-reader.js +141 -0
- package/dist/src/config/config-reader.js.map +1 -0
- package/dist/src/config/file-matcher.d.ts +10 -0
- package/dist/src/config/file-matcher.d.ts.map +1 -0
- package/dist/src/config/file-matcher.js +31 -0
- package/dist/src/config/file-matcher.js.map +1 -0
- package/dist/src/config/index.d.ts +6 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +6 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/meta-schema-builder.d.ts +10 -0
- package/dist/src/config/meta-schema-builder.d.ts.map +1 -0
- package/dist/src/config/meta-schema-builder.js +30 -0
- package/dist/src/config/meta-schema-builder.js.map +1 -0
- package/dist/src/config/options-validator.d.ts +28 -0
- package/dist/src/config/options-validator.d.ts.map +1 -0
- package/dist/src/config/options-validator.js +213 -0
- package/dist/src/config/options-validator.js.map +1 -0
- package/dist/src/config/validation-errors.d.ts +7 -0
- package/dist/src/config/validation-errors.d.ts.map +1 -0
- package/dist/src/config/validation-errors.js +154 -0
- package/dist/src/config/validation-errors.js.map +1 -0
- package/dist/src/di/core-tokens.d.ts +40 -0
- package/dist/src/di/core-tokens.d.ts.map +1 -0
- package/dist/src/di/core-tokens.js +40 -0
- package/dist/src/di/core-tokens.js.map +1 -0
- package/dist/src/di/index.d.ts +4 -0
- package/dist/src/di/index.d.ts.map +1 -0
- package/dist/src/di/index.js +4 -0
- package/dist/src/di/index.js.map +1 -0
- package/dist/src/di/plugin-creator.d.ts +10 -0
- package/dist/src/di/plugin-creator.d.ts.map +1 -0
- package/dist/src/di/plugin-creator.js +51 -0
- package/dist/src/di/plugin-creator.js.map +1 -0
- package/dist/src/di/plugin-loader.d.ts +41 -0
- package/dist/src/di/plugin-loader.d.ts.map +1 -0
- package/dist/src/di/plugin-loader.js +153 -0
- package/dist/src/di/plugin-loader.js.map +1 -0
- package/dist/src/errors.d.ts +5 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +13 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fs/file-system.d.ts +19 -0
- package/dist/src/fs/file-system.d.ts.map +1 -0
- package/dist/src/fs/file-system.js +52 -0
- package/dist/src/fs/file-system.js.map +1 -0
- package/dist/src/fs/index.d.ts +5 -0
- package/dist/src/fs/index.d.ts.map +1 -0
- package/dist/src/fs/index.js +5 -0
- package/dist/src/fs/index.js.map +1 -0
- package/dist/src/fs/project-file.d.ts +26 -0
- package/dist/src/fs/project-file.d.ts.map +1 -0
- package/dist/src/fs/project-file.js +87 -0
- package/dist/src/fs/project-file.js.map +1 -0
- package/dist/src/fs/project-reader.d.ts +51 -0
- package/dist/src/fs/project-reader.d.ts.map +1 -0
- package/dist/src/fs/project-reader.js +335 -0
- package/dist/src/fs/project-reader.js.map +1 -0
- package/dist/src/fs/project.d.ts +22 -0
- package/dist/src/fs/project.d.ts.map +1 -0
- package/dist/src/fs/project.js +65 -0
- package/dist/src/fs/project.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.d.ts +17 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.js +74 -0
- package/dist/src/initializer/custom-initializers/angular-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.d.ts +13 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.js +2 -0
- package/dist/src/initializer/custom-initializers/custom-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/index.d.ts +14 -0
- package/dist/src/initializer/custom-initializers/index.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/index.js +16 -0
- package/dist/src/initializer/custom-initializers/index.js.map +1 -0
- package/dist/src/initializer/custom-initializers/react-initializer.d.ts +12 -0
- package/dist/src/initializer/custom-initializers/react-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/react-initializer.js +25 -0
- package/dist/src/initializer/custom-initializers/react-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.d.ts +6 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.js +33 -0
- package/dist/src/initializer/custom-initializers/svelte-initializer.js.map +1 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.d.ts +11 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.d.ts.map +1 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.js +20 -0
- package/dist/src/initializer/custom-initializers/vue-js-initializer.js.map +1 -0
- package/dist/src/initializer/gitignore-writer.d.ts +7 -0
- package/dist/src/initializer/gitignore-writer.d.ts.map +1 -0
- package/dist/src/initializer/gitignore-writer.js +28 -0
- package/dist/src/initializer/gitignore-writer.js.map +1 -0
- package/dist/src/initializer/index.d.ts +6 -0
- package/dist/src/initializer/index.d.ts.map +1 -0
- package/dist/src/initializer/index.js +29 -0
- package/dist/src/initializer/index.js.map +1 -0
- package/dist/src/initializer/initializer-tokens.d.ts +9 -0
- package/dist/src/initializer/initializer-tokens.d.ts.map +1 -0
- package/dist/src/initializer/initializer-tokens.js +9 -0
- package/dist/src/initializer/initializer-tokens.js.map +1 -0
- package/dist/src/initializer/inquire.d.ts +12 -0
- package/dist/src/initializer/inquire.d.ts.map +1 -0
- package/dist/src/initializer/inquire.js +12 -0
- package/dist/src/initializer/inquire.js.map +1 -0
- package/dist/src/initializer/npm-client.d.ts +22 -0
- package/dist/src/initializer/npm-client.d.ts.map +1 -0
- package/dist/src/initializer/npm-client.js +65 -0
- package/dist/src/initializer/npm-client.js.map +1 -0
- package/dist/src/initializer/npm-registry.d.ts +13 -0
- package/dist/src/initializer/npm-registry.d.ts.map +1 -0
- package/dist/src/initializer/npm-registry.js +36 -0
- package/dist/src/initializer/npm-registry.js.map +1 -0
- package/dist/src/initializer/package-info.d.ts +10 -0
- package/dist/src/initializer/package-info.d.ts.map +1 -0
- package/dist/src/initializer/package-info.js +2 -0
- package/dist/src/initializer/package-info.js.map +1 -0
- package/dist/src/initializer/prompt-option.d.ts +6 -0
- package/dist/src/initializer/prompt-option.d.ts.map +1 -0
- package/dist/src/initializer/prompt-option.js +2 -0
- package/dist/src/initializer/prompt-option.js.map +1 -0
- package/dist/src/initializer/stryker-config-writer.d.ts +27 -0
- package/dist/src/initializer/stryker-config-writer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-config-writer.js +106 -0
- package/dist/src/initializer/stryker-config-writer.js.map +1 -0
- package/dist/src/initializer/stryker-initializer.d.ts +45 -0
- package/dist/src/initializer/stryker-initializer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-initializer.js +184 -0
- package/dist/src/initializer/stryker-initializer.js.map +1 -0
- package/dist/src/initializer/stryker-inquirer.d.ts +15 -0
- package/dist/src/initializer/stryker-inquirer.d.ts.map +1 -0
- package/dist/src/initializer/stryker-inquirer.js +72 -0
- package/dist/src/initializer/stryker-inquirer.js.map +1 -0
- package/dist/src/logging/index.d.ts +6 -0
- package/dist/src/logging/index.d.ts.map +1 -0
- package/dist/src/logging/index.js +5 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/logging/logger-impl.d.ts +19 -0
- package/dist/src/logging/logger-impl.d.ts.map +1 -0
- package/dist/src/logging/logger-impl.js +64 -0
- package/dist/src/logging/logger-impl.js.map +1 -0
- package/dist/src/logging/logging-backend.d.ts +22 -0
- package/dist/src/logging/logging-backend.d.ts.map +1 -0
- package/dist/src/logging/logging-backend.js +65 -0
- package/dist/src/logging/logging-backend.js.map +1 -0
- package/dist/src/logging/logging-client.d.ts +16 -0
- package/dist/src/logging/logging-client.d.ts.map +1 -0
- package/dist/src/logging/logging-client.js +44 -0
- package/dist/src/logging/logging-client.js.map +1 -0
- package/dist/src/logging/logging-event.d.ts +23 -0
- package/dist/src/logging/logging-event.d.ts.map +1 -0
- package/dist/src/logging/logging-event.js +63 -0
- package/dist/src/logging/logging-event.js.map +1 -0
- package/dist/src/logging/logging-server.d.ts +15 -0
- package/dist/src/logging/logging-server.d.ts.map +1 -0
- package/dist/src/logging/logging-server.js +43 -0
- package/dist/src/logging/logging-server.js.map +1 -0
- package/dist/src/logging/logging-sink.d.ts +7 -0
- package/dist/src/logging/logging-sink.d.ts.map +1 -0
- package/dist/src/logging/logging-sink.js +2 -0
- package/dist/src/logging/logging-sink.js.map +1 -0
- package/dist/src/logging/priority.d.ts +12 -0
- package/dist/src/logging/priority.d.ts.map +1 -0
- package/dist/src/logging/priority.js +13 -0
- package/dist/src/logging/priority.js.map +1 -0
- package/dist/src/logging/provide-logging.d.ts +30 -0
- package/dist/src/logging/provide-logging.d.ts.map +1 -0
- package/dist/src/logging/provide-logging.js +45 -0
- package/dist/src/logging/provide-logging.js.map +1 -0
- package/dist/src/mutants/diff-statistics-collector.d.ts +14 -0
- package/dist/src/mutants/diff-statistics-collector.d.ts.map +1 -0
- package/dist/src/mutants/diff-statistics-collector.js +40 -0
- package/dist/src/mutants/diff-statistics-collector.js.map +1 -0
- package/dist/src/mutants/incremental-differ.d.ts +39 -0
- package/dist/src/mutants/incremental-differ.d.ts.map +1 -0
- package/dist/src/mutants/incremental-differ.js +547 -0
- package/dist/src/mutants/incremental-differ.js.map +1 -0
- package/dist/src/mutants/index.d.ts +4 -0
- package/dist/src/mutants/index.d.ts.map +1 -0
- package/dist/src/mutants/index.js +4 -0
- package/dist/src/mutants/index.js.map +1 -0
- package/dist/src/mutants/mutant-test-planner.d.ts +36 -0
- package/dist/src/mutants/mutant-test-planner.d.ts.map +1 -0
- package/dist/src/mutants/mutant-test-planner.js +237 -0
- package/dist/src/mutants/mutant-test-planner.js.map +1 -0
- package/dist/src/mutants/test-coverage.d.ts +22 -0
- package/dist/src/mutants/test-coverage.d.ts.map +1 -0
- package/dist/src/mutants/test-coverage.js +87 -0
- package/dist/src/mutants/test-coverage.js.map +1 -0
- package/dist/src/process/1-prepare-executor.d.ts +22 -0
- package/dist/src/process/1-prepare-executor.d.ts.map +1 -0
- package/dist/src/process/1-prepare-executor.js +86 -0
- package/dist/src/process/1-prepare-executor.js.map +1 -0
- package/dist/src/process/2-mutant-instrumenter-executor.d.ts +39 -0
- package/dist/src/process/2-mutant-instrumenter-executor.d.ts.map +1 -0
- package/dist/src/process/2-mutant-instrumenter-executor.js +58 -0
- package/dist/src/process/2-mutant-instrumenter-executor.js.map +1 -0
- package/dist/src/process/3-dry-run-executor.d.ts +50 -0
- package/dist/src/process/3-dry-run-executor.d.ts.map +1 -0
- package/dist/src/process/3-dry-run-executor.js +164 -0
- package/dist/src/process/3-dry-run-executor.js.map +1 -0
- package/dist/src/process/4-mutation-test-executor.d.ts +56 -0
- package/dist/src/process/4-mutation-test-executor.d.ts.map +1 -0
- package/dist/src/process/4-mutation-test-executor.js +152 -0
- package/dist/src/process/4-mutation-test-executor.js.map +1 -0
- package/dist/src/process/index.d.ts +5 -0
- package/dist/src/process/index.d.ts.map +1 -0
- package/dist/src/process/index.js +5 -0
- package/dist/src/process/index.js.map +1 -0
- package/dist/src/reporters/broadcast-reporter.d.ts +25 -0
- package/dist/src/reporters/broadcast-reporter.d.ts.map +1 -0
- package/dist/src/reporters/broadcast-reporter.js +74 -0
- package/dist/src/reporters/broadcast-reporter.js.map +1 -0
- package/dist/src/reporters/ci/circle-provider.d.ts +11 -0
- package/dist/src/reporters/ci/circle-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/circle-provider.js +33 -0
- package/dist/src/reporters/ci/circle-provider.js.map +1 -0
- package/dist/src/reporters/ci/github-actions-provider.d.ts +9 -0
- package/dist/src/reporters/ci/github-actions-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/github-actions-provider.js +21 -0
- package/dist/src/reporters/ci/github-actions-provider.js.map +1 -0
- package/dist/src/reporters/ci/provider.d.ts +22 -0
- package/dist/src/reporters/ci/provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/provider.js +24 -0
- package/dist/src/reporters/ci/provider.js.map +1 -0
- package/dist/src/reporters/ci/travis-provider.d.ts +9 -0
- package/dist/src/reporters/ci/travis-provider.d.ts.map +1 -0
- package/dist/src/reporters/ci/travis-provider.js +19 -0
- package/dist/src/reporters/ci/travis-provider.js.map +1 -0
- package/dist/src/reporters/clear-text-reporter.d.ts +23 -0
- package/dist/src/reporters/clear-text-reporter.d.ts.map +1 -0
- package/dist/src/reporters/clear-text-reporter.js +174 -0
- package/dist/src/reporters/clear-text-reporter.js.map +1 -0
- package/dist/src/reporters/clear-text-score-table.d.ts +22 -0
- package/dist/src/reporters/clear-text-score-table.d.ts.map +1 -0
- package/dist/src/reporters/clear-text-score-table.js +191 -0
- package/dist/src/reporters/clear-text-score-table.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.d.ts +19 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.js +54 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter-client.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.d.ts +21 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.js +62 -0
- package/dist/src/reporters/dashboard-reporter/dashboard-reporter.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/index.d.ts +7 -0
- package/dist/src/reporters/dashboard-reporter/index.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/index.js +15 -0
- package/dist/src/reporters/dashboard-reporter/index.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/report.d.ts +6 -0
- package/dist/src/reporters/dashboard-reporter/report.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/report.js +2 -0
- package/dist/src/reporters/dashboard-reporter/report.js.map +1 -0
- package/dist/src/reporters/dashboard-reporter/tokens.d.ts +6 -0
- package/dist/src/reporters/dashboard-reporter/tokens.d.ts.map +1 -0
- package/dist/src/reporters/dashboard-reporter/tokens.js +6 -0
- package/dist/src/reporters/dashboard-reporter/tokens.js.map +1 -0
- package/dist/src/reporters/dots-reporter.d.ts +7 -0
- package/dist/src/reporters/dots-reporter.d.ts.map +1 -0
- package/dist/src/reporters/dots-reporter.js +29 -0
- package/dist/src/reporters/dots-reporter.js.map +1 -0
- package/dist/src/reporters/event-recorder-reporter.d.ts +22 -0
- package/dist/src/reporters/event-recorder-reporter.d.ts.map +1 -0
- package/dist/src/reporters/event-recorder-reporter.js +53 -0
- package/dist/src/reporters/event-recorder-reporter.js.map +1 -0
- package/dist/src/reporters/html-reporter.d.ts +14 -0
- package/dist/src/reporters/html-reporter.d.ts.map +1 -0
- package/dist/src/reporters/html-reporter.js +65 -0
- package/dist/src/reporters/html-reporter.js.map +1 -0
- package/dist/src/reporters/index.d.ts +6 -0
- package/dist/src/reporters/index.d.ts.map +1 -0
- package/dist/src/reporters/index.js +24 -0
- package/dist/src/reporters/index.js.map +1 -0
- package/dist/src/reporters/json-reporter.d.ts +15 -0
- package/dist/src/reporters/json-reporter.d.ts.map +1 -0
- package/dist/src/reporters/json-reporter.js +29 -0
- package/dist/src/reporters/json-reporter.js.map +1 -0
- package/dist/src/reporters/mutation-test-report-helper.d.ts +40 -0
- package/dist/src/reporters/mutation-test-report-helper.d.ts.map +1 -0
- package/dist/src/reporters/mutation-test-report-helper.js +298 -0
- package/dist/src/reporters/mutation-test-report-helper.js.map +1 -0
- package/dist/src/reporters/mutation-timings-reporter.d.ts +14 -0
- package/dist/src/reporters/mutation-timings-reporter.d.ts.map +1 -0
- package/dist/src/reporters/mutation-timings-reporter.js +49 -0
- package/dist/src/reporters/mutation-timings-reporter.js.map +1 -0
- package/dist/src/reporters/progress-append-only-reporter.d.ts +10 -0
- package/dist/src/reporters/progress-append-only-reporter.d.ts.map +1 -0
- package/dist/src/reporters/progress-append-only-reporter.js +25 -0
- package/dist/src/reporters/progress-append-only-reporter.js.map +1 -0
- package/dist/src/reporters/progress-bar.d.ts +8 -0
- package/dist/src/reporters/progress-bar.d.ts.map +1 -0
- package/dist/src/reporters/progress-bar.js +6 -0
- package/dist/src/reporters/progress-bar.js.map +1 -0
- package/dist/src/reporters/progress-keeper.d.ts +27 -0
- package/dist/src/reporters/progress-keeper.d.ts.map +1 -0
- package/dist/src/reporters/progress-keeper.js +77 -0
- package/dist/src/reporters/progress-keeper.js.map +1 -0
- package/dist/src/reporters/progress-reporter.d.ts +11 -0
- package/dist/src/reporters/progress-reporter.d.ts.map +1 -0
- package/dist/src/reporters/progress-reporter.js +40 -0
- package/dist/src/reporters/progress-reporter.js.map +1 -0
- package/dist/src/reporters/reporter-util.d.ts +5 -0
- package/dist/src/reporters/reporter-util.d.ts.map +1 -0
- package/dist/src/reporters/reporter-util.js +19 -0
- package/dist/src/reporters/reporter-util.js.map +1 -0
- package/dist/src/reporters/strict-reporter.d.ts +3 -0
- package/dist/src/reporters/strict-reporter.d.ts.map +1 -0
- package/dist/src/reporters/strict-reporter.js +2 -0
- package/dist/src/reporters/strict-reporter.js.map +1 -0
- package/dist/src/sandbox/create-preprocessor.d.ts +7 -0
- package/dist/src/sandbox/create-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/create-preprocessor.js +16 -0
- package/dist/src/sandbox/create-preprocessor.js.map +1 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.d.ts +18 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.js +43 -0
- package/dist/src/sandbox/disable-type-checks-preprocessor.js.map +1 -0
- package/dist/src/sandbox/file-preprocessor.d.ts +10 -0
- package/dist/src/sandbox/file-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/file-preprocessor.js +2 -0
- package/dist/src/sandbox/file-preprocessor.js.map +1 -0
- package/dist/src/sandbox/index.d.ts +4 -0
- package/dist/src/sandbox/index.d.ts.map +1 -0
- package/dist/src/sandbox/index.js +3 -0
- package/dist/src/sandbox/index.js.map +1 -0
- package/dist/src/sandbox/multi-preprocessor.d.ts +8 -0
- package/dist/src/sandbox/multi-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/multi-preprocessor.js +12 -0
- package/dist/src/sandbox/multi-preprocessor.js.map +1 -0
- package/dist/src/sandbox/sandbox.d.ts +43 -0
- package/dist/src/sandbox/sandbox.d.ts.map +1 -0
- package/dist/src/sandbox/sandbox.js +134 -0
- package/dist/src/sandbox/sandbox.js.map +1 -0
- package/dist/src/sandbox/ts-config-preprocessor.d.ts +46 -0
- package/dist/src/sandbox/ts-config-preprocessor.d.ts.map +1 -0
- package/dist/src/sandbox/ts-config-preprocessor.js +112 -0
- package/dist/src/sandbox/ts-config-preprocessor.js.map +1 -0
- package/dist/src/stryker-cli.d.ts +15 -0
- package/dist/src/stryker-cli.d.ts.map +1 -0
- package/dist/src/stryker-cli.js +168 -0
- package/dist/src/stryker-cli.js.map +1 -0
- package/dist/src/stryker-package.d.ts +5 -0
- package/dist/src/stryker-package.d.ts.map +1 -0
- package/dist/src/stryker-package.js +7 -0
- package/dist/src/stryker-package.js.map +1 -0
- package/dist/src/stryker-server.d.ts +40 -0
- package/dist/src/stryker-server.d.ts.map +1 -0
- package/dist/src/stryker-server.js +234 -0
- package/dist/src/stryker-server.js.map +1 -0
- package/dist/src/stryker.d.ts +31 -0
- package/dist/src/stryker.d.ts.map +1 -0
- package/dist/src/stryker.js +86 -0
- package/dist/src/stryker.js.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.d.ts +19 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.d.ts.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.js +45 -0
- package/dist/src/test-runner/child-process-test-runner-proxy.js.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-worker.d.ts +14 -0
- package/dist/src/test-runner/child-process-test-runner-worker.d.ts.map +1 -0
- package/dist/src/test-runner/child-process-test-runner-worker.js +45 -0
- package/dist/src/test-runner/child-process-test-runner-worker.js.map +1 -0
- package/dist/src/test-runner/command-test-runner.d.ts +31 -0
- package/dist/src/test-runner/command-test-runner.d.ts.map +1 -0
- package/dist/src/test-runner/command-test-runner.js +144 -0
- package/dist/src/test-runner/command-test-runner.js.map +1 -0
- package/dist/src/test-runner/index.d.ts +11 -0
- package/dist/src/test-runner/index.d.ts.map +1 -0
- package/dist/src/test-runner/index.js +18 -0
- package/dist/src/test-runner/index.js.map +1 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.d.ts +14 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.js +25 -0
- package/dist/src/test-runner/max-test-runner-reuse-decorator.js.map +1 -0
- package/dist/src/test-runner/reload-environment-decorator.d.ts +11 -0
- package/dist/src/test-runner/reload-environment-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/reload-environment-decorator.js +56 -0
- package/dist/src/test-runner/reload-environment-decorator.js.map +1 -0
- package/dist/src/test-runner/retry-rejected-decorator.d.ts +15 -0
- package/dist/src/test-runner/retry-rejected-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/retry-rejected-decorator.js +59 -0
- package/dist/src/test-runner/retry-rejected-decorator.js.map +1 -0
- package/dist/src/test-runner/test-runner-decorator.d.ts +8 -0
- package/dist/src/test-runner/test-runner-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/test-runner-decorator.js +13 -0
- package/dist/src/test-runner/test-runner-decorator.js.map +1 -0
- package/dist/src/test-runner/timeout-decorator.d.ts +15 -0
- package/dist/src/test-runner/timeout-decorator.d.ts.map +1 -0
- package/dist/src/test-runner/timeout-decorator.js +51 -0
- package/dist/src/test-runner/timeout-decorator.js.map +1 -0
- package/dist/src/unexpected-exit-handler.d.ts +13 -0
- package/dist/src/unexpected-exit-handler.d.ts.map +1 -0
- package/dist/src/unexpected-exit-handler.js +28 -0
- package/dist/src/unexpected-exit-handler.js.map +1 -0
- package/dist/src/utils/file-utils.d.ts +30 -0
- package/dist/src/utils/file-utils.d.ts.map +1 -0
- package/dist/src/utils/file-utils.js +101 -0
- package/dist/src/utils/file-utils.js.map +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +7 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/json-rpc-event-deserializer.d.ts +5 -0
- package/dist/src/utils/json-rpc-event-deserializer.d.ts.map +1 -0
- package/dist/src/utils/json-rpc-event-deserializer.js +42 -0
- package/dist/src/utils/json-rpc-event-deserializer.js.map +1 -0
- package/dist/src/utils/object-utils.d.ts +37 -0
- package/dist/src/utils/object-utils.d.ts.map +1 -0
- package/dist/src/utils/object-utils.js +91 -0
- package/dist/src/utils/object-utils.js.map +1 -0
- package/dist/src/utils/string-builder.d.ts +9 -0
- package/dist/src/utils/string-builder.d.ts.map +1 -0
- package/dist/src/utils/string-builder.js +26 -0
- package/dist/src/utils/string-builder.js.map +1 -0
- package/dist/src/utils/string-utils.d.ts +12 -0
- package/dist/src/utils/string-utils.d.ts.map +1 -0
- package/dist/src/utils/string-utils.js +54 -0
- package/dist/src/utils/string-utils.js.map +1 -0
- package/dist/src/utils/temporary-directory.d.ts +18 -0
- package/dist/src/utils/temporary-directory.d.ts.map +1 -0
- package/dist/src/utils/temporary-directory.js +63 -0
- package/dist/src/utils/temporary-directory.js.map +1 -0
- package/dist/src/utils/timer.d.ts +14 -0
- package/dist/src/utils/timer.d.ts.map +1 -0
- package/dist/src/utils/timer.js +53 -0
- package/dist/src/utils/timer.js.map +1 -0
- package/package.json +106 -0
- package/schema/stryker-schema.json +855 -0
- package/src/checker/checker-child-process-proxy.ts +67 -0
- package/src/checker/checker-facade.ts +90 -0
- package/src/checker/checker-factory.ts +46 -0
- package/src/checker/checker-resource.ts +12 -0
- package/src/checker/checker-retry-decorator.ts +57 -0
- package/src/checker/checker-worker.ts +62 -0
- package/src/checker/index.ts +3 -0
- package/src/child-proxy/child-process-crashed-error.ts +16 -0
- package/src/child-proxy/child-process-proxy-worker.ts +203 -0
- package/src/child-proxy/child-process-proxy.ts +353 -0
- package/src/child-proxy/id-generator.ts +6 -0
- package/src/child-proxy/message-protocol.ts +87 -0
- package/src/child-proxy/out-of-memory-error.ts +11 -0
- package/src/concurrent/concurrency-token-provider.ts +106 -0
- package/src/concurrent/index.ts +3 -0
- package/src/concurrent/pool.ts +209 -0
- package/src/concurrent/resource-decorator.ts +28 -0
- package/src/config/config-file-formats.ts +31 -0
- package/src/config/config-reader.ts +193 -0
- package/src/config/file-matcher.ts +36 -0
- package/src/config/index.ts +5 -0
- package/src/config/meta-schema-builder.ts +50 -0
- package/src/config/options-validator.ts +317 -0
- package/src/config/validation-errors.ts +192 -0
- package/src/di/core-tokens.ts +39 -0
- package/src/di/index.ts +4 -0
- package/src/di/plugin-creator.ts +102 -0
- package/src/di/plugin-loader.ts +245 -0
- package/src/errors.ts +12 -0
- package/src/fs/file-system.ts +63 -0
- package/src/fs/index.ts +4 -0
- package/src/fs/project-file.ts +100 -0
- package/src/fs/project-reader.ts +493 -0
- package/src/fs/project.ts +98 -0
- package/src/index.ts +7 -0
- package/src/initializer/custom-initializers/angular-initializer.ts +95 -0
- package/src/initializer/custom-initializers/custom-initializer.ts +14 -0
- package/src/initializer/custom-initializers/index.ts +31 -0
- package/src/initializer/custom-initializers/react-initializer.ts +35 -0
- package/src/initializer/custom-initializers/svelte-initializer.ts +40 -0
- package/src/initializer/custom-initializers/vue-js-initializer.ts +30 -0
- package/src/initializer/gitignore-writer.ts +33 -0
- package/src/initializer/index.ts +35 -0
- package/src/initializer/initializer-tokens.ts +8 -0
- package/src/initializer/inquire.ts +17 -0
- package/src/initializer/npm-client.ts +103 -0
- package/src/initializer/npm-registry.ts +48 -0
- package/src/initializer/package-info.ts +10 -0
- package/src/initializer/prompt-option.ts +6 -0
- package/src/initializer/stryker-config-writer.ts +158 -0
- package/src/initializer/stryker-initializer.ts +278 -0
- package/src/initializer/stryker-inquirer.ts +101 -0
- package/src/logging/index.ts +5 -0
- package/src/logging/logger-impl.ts +81 -0
- package/src/logging/logging-backend.ts +90 -0
- package/src/logging/logging-client.ts +56 -0
- package/src/logging/logging-event.ts +94 -0
- package/src/logging/logging-server.ts +56 -0
- package/src/logging/logging-sink.ts +7 -0
- package/src/logging/priority.ts +15 -0
- package/src/logging/provide-logging.ts +70 -0
- package/src/mutants/diff-statistics-collector.ts +47 -0
- package/src/mutants/incremental-differ.ts +771 -0
- package/src/mutants/index.ts +3 -0
- package/src/mutants/mutant-test-planner.ts +357 -0
- package/src/mutants/test-coverage.ts +125 -0
- package/src/process/1-prepare-executor.ts +133 -0
- package/src/process/2-mutant-instrumenter-executor.ts +122 -0
- package/src/process/3-dry-run-executor.ts +262 -0
- package/src/process/4-mutation-test-executor.ts +272 -0
- package/src/process/index.ts +4 -0
- package/src/reporters/broadcast-reporter.ts +129 -0
- package/src/reporters/ci/circle-provider.ts +50 -0
- package/src/reporters/ci/github-actions-provider.ts +22 -0
- package/src/reporters/ci/provider.ts +42 -0
- package/src/reporters/ci/travis-provider.ts +24 -0
- package/src/reporters/clear-text-reporter.ts +245 -0
- package/src/reporters/clear-text-score-table.ts +305 -0
- package/src/reporters/dashboard-reporter/dashboard-reporter-client.ts +89 -0
- package/src/reporters/dashboard-reporter/dashboard-reporter.ts +97 -0
- package/src/reporters/dashboard-reporter/index.ts +30 -0
- package/src/reporters/dashboard-reporter/report.ts +6 -0
- package/src/reporters/dashboard-reporter/tokens.ts +5 -0
- package/src/reporters/dots-reporter.ts +33 -0
- package/src/reporters/event-recorder-reporter.ts +88 -0
- package/src/reporters/html-reporter.ts +87 -0
- package/src/reporters/index.ts +48 -0
- package/src/reporters/json-reporter.ts +45 -0
- package/src/reporters/mutation-test-report-helper.ts +425 -0
- package/src/reporters/mutation-timings-reporter.ts +78 -0
- package/src/reporters/progress-append-only-reporter.ts +36 -0
- package/src/reporters/progress-bar.ts +6 -0
- package/src/reporters/progress-keeper.ts +113 -0
- package/src/reporters/progress-reporter.ts +62 -0
- package/src/reporters/reporter-util.ts +20 -0
- package/src/reporters/strict-reporter.ts +3 -0
- package/src/sandbox/create-preprocessor.ts +27 -0
- package/src/sandbox/disable-type-checks-preprocessor.ts +70 -0
- package/src/sandbox/file-preprocessor.ts +10 -0
- package/src/sandbox/index.ts +3 -0
- package/src/sandbox/multi-preprocessor.ts +13 -0
- package/src/sandbox/sandbox.ts +198 -0
- package/src/sandbox/ts-config-preprocessor.ts +168 -0
- package/src/stryker-cli.ts +363 -0
- package/src/stryker-package.ts +19 -0
- package/src/stryker-server.ts +334 -0
- package/src/stryker.ts +126 -0
- package/src/test-runner/child-process-test-runner-proxy.ts +94 -0
- package/src/test-runner/child-process-test-runner-worker.ts +66 -0
- package/src/test-runner/command-test-runner.ts +190 -0
- package/src/test-runner/index.ts +74 -0
- package/src/test-runner/max-test-runner-reuse-decorator.ts +41 -0
- package/src/test-runner/reload-environment-decorator.ts +72 -0
- package/src/test-runner/retry-rejected-decorator.ts +79 -0
- package/src/test-runner/test-runner-decorator.ts +22 -0
- package/src/test-runner/timeout-decorator.ts +71 -0
- package/src/unexpected-exit-handler.ts +36 -0
- package/src/utils/file-utils.ts +113 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/json-rpc-event-deserializer.ts +48 -0
- package/src/utils/object-utils.ts +106 -0
- package/src/utils/string-builder.ts +30 -0
- package/src/utils/string-utils.ts +61 -0
- package/src/utils/temporary-directory.ts +83 -0
- package/src/utils/timer.ts +58 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { TestRunner } from '@stryker-mutator/api/test-runner';
|
|
2
|
+
import { notEmpty } from '@stryker-mutator/util';
|
|
3
|
+
import {
|
|
4
|
+
BehaviorSubject,
|
|
5
|
+
filter,
|
|
6
|
+
ignoreElements,
|
|
7
|
+
lastValueFrom,
|
|
8
|
+
mergeMap,
|
|
9
|
+
Observable,
|
|
10
|
+
ReplaySubject,
|
|
11
|
+
Subject,
|
|
12
|
+
takeUntil,
|
|
13
|
+
tap,
|
|
14
|
+
zip,
|
|
15
|
+
} from 'rxjs';
|
|
16
|
+
import { Disposable, tokens } from 'typed-inject';
|
|
17
|
+
|
|
18
|
+
import { CheckerFacade } from '../checker/index.js';
|
|
19
|
+
import { coreTokens } from '../di/index.js';
|
|
20
|
+
|
|
21
|
+
const MAX_CONCURRENT_INIT = 2;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Represents a TestRunner that is also a Resource (with an init and dispose)
|
|
25
|
+
*/
|
|
26
|
+
export type TestRunnerResource = Resource & TestRunner;
|
|
27
|
+
|
|
28
|
+
export interface Resource extends Partial<Disposable> {
|
|
29
|
+
init?(): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
createTestRunnerPool.inject = tokens(
|
|
33
|
+
coreTokens.testRunnerFactory,
|
|
34
|
+
coreTokens.testRunnerConcurrencyTokens,
|
|
35
|
+
);
|
|
36
|
+
export function createTestRunnerPool(
|
|
37
|
+
factory: () => TestRunnerResource,
|
|
38
|
+
concurrencyToken$: Observable<number>,
|
|
39
|
+
): Pool<TestRunner> {
|
|
40
|
+
return new Pool(factory, concurrencyToken$);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
createCheckerPool.inject = tokens(
|
|
44
|
+
coreTokens.checkerFactory,
|
|
45
|
+
coreTokens.checkerConcurrencyTokens,
|
|
46
|
+
);
|
|
47
|
+
export function createCheckerPool(
|
|
48
|
+
factory: () => CheckerFacade,
|
|
49
|
+
concurrencyToken$: Observable<number>,
|
|
50
|
+
): Pool<CheckerFacade> {
|
|
51
|
+
return new Pool<CheckerFacade>(factory, concurrencyToken$);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Represents a work item: an input with a task and with a `result$` observable where the result (exactly one) will be streamed to.
|
|
56
|
+
*/
|
|
57
|
+
class WorkItem<TResource extends Resource, TIn, TOut> {
|
|
58
|
+
private readonly resultSubject = new Subject<TOut>();
|
|
59
|
+
public readonly result$ = this.resultSubject.asObservable();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param input The input to the ask
|
|
63
|
+
* @param task The task, where a resource and input is presented
|
|
64
|
+
*/
|
|
65
|
+
constructor(
|
|
66
|
+
private readonly input: TIn,
|
|
67
|
+
private readonly task: (
|
|
68
|
+
resource: TResource,
|
|
69
|
+
input: TIn,
|
|
70
|
+
) => Promise<TOut> | TOut,
|
|
71
|
+
) {}
|
|
72
|
+
|
|
73
|
+
public async execute(resource: TResource) {
|
|
74
|
+
try {
|
|
75
|
+
const output = await this.task(resource, this.input);
|
|
76
|
+
this.resultSubject.next(output);
|
|
77
|
+
this.resultSubject.complete();
|
|
78
|
+
} catch (err) {
|
|
79
|
+
this.resultSubject.error(err);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public reject(error: unknown) {
|
|
84
|
+
this.resultSubject.error(error);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public complete() {
|
|
88
|
+
this.resultSubject.complete();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Represents a pool of resources. Use `schedule` to schedule work to be executed on the resources.
|
|
94
|
+
* The pool will automatically recycle the resources, but will make sure only one task is executed
|
|
95
|
+
* on one resource at any one time. Creates as many resources as the concurrency tokens allow.
|
|
96
|
+
* Also takes care of the initialing of the resources (with `init()`)
|
|
97
|
+
*/
|
|
98
|
+
export class Pool<TResource extends Resource> implements Disposable {
|
|
99
|
+
// The init subject. Using an RxJS subject instead of a promise, so errors are silently ignored when nobody is listening
|
|
100
|
+
private readonly initSubject = new ReplaySubject<void>();
|
|
101
|
+
|
|
102
|
+
// The disposedSubject emits true when it is disposed, and false when not disposed yet
|
|
103
|
+
private readonly disposedSubject = new BehaviorSubject(false);
|
|
104
|
+
|
|
105
|
+
// The dispose$ only emits one `true` value when disposed (never emits `false`). Useful for `takeUntil`
|
|
106
|
+
private readonly dispose$ = this.disposedSubject.pipe(
|
|
107
|
+
filter((isDisposed) => isDisposed),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
private readonly createdResources: TResource[] = [];
|
|
111
|
+
// The queued work items. This is a replay subject, so scheduled work items can easily be rejected after it was picked up
|
|
112
|
+
private readonly todoSubject = new ReplaySubject<
|
|
113
|
+
WorkItem<TResource, any, any>
|
|
114
|
+
>();
|
|
115
|
+
|
|
116
|
+
constructor(factory: () => TResource, concurrencyToken$: Observable<number>) {
|
|
117
|
+
// Stream resources that are ready to pick up work
|
|
118
|
+
const resourcesSubject = new Subject<TResource>();
|
|
119
|
+
|
|
120
|
+
// Stream ongoing work.
|
|
121
|
+
zip(resourcesSubject, this.todoSubject)
|
|
122
|
+
.pipe(
|
|
123
|
+
mergeMap(async ([resource, workItem]) => {
|
|
124
|
+
await workItem.execute(resource);
|
|
125
|
+
resourcesSubject.next(resource); // recycle resource so it can pick up more work
|
|
126
|
+
}),
|
|
127
|
+
ignoreElements(),
|
|
128
|
+
takeUntil(this.dispose$),
|
|
129
|
+
)
|
|
130
|
+
.subscribe({
|
|
131
|
+
error: (error) => {
|
|
132
|
+
this.todoSubject.subscribe((workItem) => workItem.reject(error));
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Create resources
|
|
137
|
+
concurrencyToken$
|
|
138
|
+
.pipe(
|
|
139
|
+
takeUntil(this.dispose$),
|
|
140
|
+
mergeMap(async () => {
|
|
141
|
+
if (this.disposedSubject.value) {
|
|
142
|
+
// Don't create new resources when disposed
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const resource = factory();
|
|
146
|
+
this.createdResources.push(resource);
|
|
147
|
+
await resource.init?.();
|
|
148
|
+
return resource;
|
|
149
|
+
}, MAX_CONCURRENT_INIT),
|
|
150
|
+
filter(notEmpty),
|
|
151
|
+
tap({
|
|
152
|
+
complete: () => {
|
|
153
|
+
// Signal init complete
|
|
154
|
+
this.initSubject.next();
|
|
155
|
+
this.initSubject.complete();
|
|
156
|
+
},
|
|
157
|
+
error: (err) => {
|
|
158
|
+
this.initSubject.error(err);
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
)
|
|
162
|
+
.subscribe({
|
|
163
|
+
next: (resource) => resourcesSubject.next(resource),
|
|
164
|
+
error: (err) => resourcesSubject.error(err),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Returns a promise that resolves if all concurrency tokens have resulted in initialized resources.
|
|
170
|
+
* This is optional, resources will get initialized either way.
|
|
171
|
+
*/
|
|
172
|
+
public async init(): Promise<void> {
|
|
173
|
+
await lastValueFrom(this.initSubject);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Schedules a task to be executed on resources in the pool. Each input is paired with a resource, which allows async work to be done.
|
|
178
|
+
* @param input$ The inputs to pair up with a resource.
|
|
179
|
+
* @param task The task to execute on each resource
|
|
180
|
+
*/
|
|
181
|
+
public schedule<TIn, TOut>(
|
|
182
|
+
input$: Observable<TIn>,
|
|
183
|
+
task: (resource: TResource, input: TIn) => Promise<TOut> | TOut,
|
|
184
|
+
): Observable<TOut> {
|
|
185
|
+
return input$.pipe(
|
|
186
|
+
mergeMap((input) => {
|
|
187
|
+
const workItem = new WorkItem(input, task);
|
|
188
|
+
this.todoSubject.next(workItem);
|
|
189
|
+
return workItem.result$;
|
|
190
|
+
}),
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Dispose the pool
|
|
196
|
+
*/
|
|
197
|
+
public async dispose(): Promise<void> {
|
|
198
|
+
if (!this.disposedSubject.value) {
|
|
199
|
+
this.disposedSubject.next(true);
|
|
200
|
+
this.todoSubject.subscribe((workItem) => workItem.complete());
|
|
201
|
+
this.todoSubject.complete();
|
|
202
|
+
await Promise.all(
|
|
203
|
+
// We're mixing promises with undefined values, which triggers the lint warning. We can safely ignore it here.
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
205
|
+
this.createdResources.map((resource) => resource.dispose?.()),
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Resource } from './pool.js';
|
|
2
|
+
|
|
3
|
+
export abstract class ResourceDecorator<
|
|
4
|
+
T extends Resource,
|
|
5
|
+
> implements Resource {
|
|
6
|
+
protected innerResource: T;
|
|
7
|
+
|
|
8
|
+
constructor(private readonly producer: () => T) {
|
|
9
|
+
this.innerResource = producer();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async init(): Promise<void> {
|
|
13
|
+
await this.innerResource.init?.();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async dispose(): Promise<void> {
|
|
17
|
+
await this.innerResource.dispose?.();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Disposes the current test runner and creates a new one
|
|
21
|
+
* To be used in decorators that need recreation.
|
|
22
|
+
*/
|
|
23
|
+
protected async recover(): Promise<void> {
|
|
24
|
+
await this.dispose();
|
|
25
|
+
this.innerResource = this.producer();
|
|
26
|
+
return this.init();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const combine = (
|
|
2
|
+
prefixes: string[],
|
|
3
|
+
suffixes: string[],
|
|
4
|
+
extensions: string[],
|
|
5
|
+
): string[] => {
|
|
6
|
+
const fileNames: string[] = [];
|
|
7
|
+
for (const prefix of prefixes) {
|
|
8
|
+
for (const suffix of suffixes) {
|
|
9
|
+
for (const extension of extensions) {
|
|
10
|
+
fileNames.push(`${prefix}stryker${suffix}.${extension}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return fileNames;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const SUPPORTED_CONFIG_FILE_NAMES = Object.freeze(
|
|
18
|
+
combine(
|
|
19
|
+
// Prefixes.
|
|
20
|
+
['', '.'],
|
|
21
|
+
// Suffixes.
|
|
22
|
+
['.conf', '.config'],
|
|
23
|
+
// Extensions.
|
|
24
|
+
['json', 'js', 'mjs', 'cjs'],
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const DEFAULT_CONFIG_FILE_NAMES = Object.freeze({
|
|
29
|
+
JSON: 'stryker.config.json',
|
|
30
|
+
JAVASCRIPT: 'stryker.config.mjs',
|
|
31
|
+
} as const);
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { pathToFileURL } from 'url';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
PartialStrykerOptions,
|
|
7
|
+
StrykerOptions,
|
|
8
|
+
} from '@stryker-mutator/api/core';
|
|
9
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
10
|
+
import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
|
|
11
|
+
import { deepMerge, I } from '@stryker-mutator/util';
|
|
12
|
+
|
|
13
|
+
import { coreTokens } from '../di/index.js';
|
|
14
|
+
import { ConfigError } from '../errors.js';
|
|
15
|
+
import { fileUtils } from '../utils/file-utils.js';
|
|
16
|
+
|
|
17
|
+
import { OptionsValidator } from './options-validator.js';
|
|
18
|
+
import { SUPPORTED_CONFIG_FILE_NAMES } from './config-file-formats.js';
|
|
19
|
+
|
|
20
|
+
export const CONFIG_SYNTAX_HELP = `
|
|
21
|
+
Example of how a config file should look:
|
|
22
|
+
/**
|
|
23
|
+
* @type {import('@stryker-mutator/api/core').StrykerOptions}
|
|
24
|
+
*/
|
|
25
|
+
export default {
|
|
26
|
+
// You're options here!
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Or using commonjs:
|
|
30
|
+
/**
|
|
31
|
+
* @type {import('@stryker-mutator/api/core').StrykerOptions}
|
|
32
|
+
*/
|
|
33
|
+
module.exports = {
|
|
34
|
+
// You're options here!
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
See https://stryker-mutator.io/docs/stryker-js/config-file for more information.`.trim();
|
|
38
|
+
|
|
39
|
+
export class ConfigReader {
|
|
40
|
+
public static inject = tokens(
|
|
41
|
+
commonTokens.logger,
|
|
42
|
+
coreTokens.optionsValidator,
|
|
43
|
+
);
|
|
44
|
+
constructor(
|
|
45
|
+
private readonly log: Logger,
|
|
46
|
+
private readonly validator: I<OptionsValidator>,
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
public async readConfig(
|
|
50
|
+
cliOptions: PartialStrykerOptions,
|
|
51
|
+
): Promise<StrykerOptions> {
|
|
52
|
+
const options = await this.loadOptionsFromConfigFile(cliOptions);
|
|
53
|
+
|
|
54
|
+
// merge the config from config file and cliOptions (precedence)
|
|
55
|
+
deepMerge(options, cliOptions);
|
|
56
|
+
this.validator.validate(options);
|
|
57
|
+
if (this.log.isDebugEnabled()) {
|
|
58
|
+
this.log.debug(`Loaded config: ${JSON.stringify(options, null, 2)}`);
|
|
59
|
+
}
|
|
60
|
+
return options;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private async loadOptionsFromConfigFile(
|
|
64
|
+
cliOptions: PartialStrykerOptions,
|
|
65
|
+
): Promise<PartialStrykerOptions> {
|
|
66
|
+
const configFile = await this.findConfigFile(cliOptions.configFile);
|
|
67
|
+
if (!configFile) {
|
|
68
|
+
this.log.info(
|
|
69
|
+
'No config file specified. Running with command line arguments.',
|
|
70
|
+
);
|
|
71
|
+
this.log.info('Use `stryker init` command to generate your config file.');
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
this.log.debug(`Loading config from ${configFile}`);
|
|
75
|
+
|
|
76
|
+
if (path.extname(configFile).toLocaleLowerCase() === '.json') {
|
|
77
|
+
return this.readJsonConfig(configFile);
|
|
78
|
+
} else {
|
|
79
|
+
return this.importJSConfig(configFile);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private async findConfigFile(
|
|
84
|
+
configFileName: unknown,
|
|
85
|
+
): Promise<string | undefined> {
|
|
86
|
+
if (typeof configFileName === 'string') {
|
|
87
|
+
if (await fileUtils.exists(configFileName)) {
|
|
88
|
+
return configFileName;
|
|
89
|
+
} else {
|
|
90
|
+
throw new ConfigReaderError('File does not exist!', configFileName);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const fileName of SUPPORTED_CONFIG_FILE_NAMES) {
|
|
94
|
+
if (await fileUtils.exists(fileName)) {
|
|
95
|
+
return fileName;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private async readJsonConfig(
|
|
102
|
+
configFile: string,
|
|
103
|
+
): Promise<PartialStrykerOptions> {
|
|
104
|
+
const fileContent = await fs.promises.readFile(configFile, 'utf-8');
|
|
105
|
+
try {
|
|
106
|
+
return JSON.parse(fileContent);
|
|
107
|
+
} catch (err) {
|
|
108
|
+
throw new ConfigReaderError(
|
|
109
|
+
'File contains invalid JSON',
|
|
110
|
+
configFile,
|
|
111
|
+
err,
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private async importJSConfig(
|
|
117
|
+
configFile: string,
|
|
118
|
+
): Promise<PartialStrykerOptions> {
|
|
119
|
+
const importedModule = await this.importJSConfigModule(configFile);
|
|
120
|
+
|
|
121
|
+
if (this.hasDefaultExport(importedModule)) {
|
|
122
|
+
const maybeOptions = importedModule.default;
|
|
123
|
+
if (typeof maybeOptions !== 'object') {
|
|
124
|
+
if (typeof maybeOptions === 'function') {
|
|
125
|
+
this.log.fatal(
|
|
126
|
+
`Invalid config file. Exporting a function is no longer supported. Please export an object with your configuration instead, or use a "stryker.conf.json" file.\n${CONFIG_SYNTAX_HELP}`,
|
|
127
|
+
);
|
|
128
|
+
} else {
|
|
129
|
+
this.log.fatal(
|
|
130
|
+
`Invalid config file. It must export an object, found a "${typeof maybeOptions}"!\n${CONFIG_SYNTAX_HELP}`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
throw new ConfigReaderError(
|
|
134
|
+
'Default export of config file must be an object!',
|
|
135
|
+
configFile,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
if (!maybeOptions || !Object.keys(maybeOptions).length) {
|
|
139
|
+
this.log.warn(
|
|
140
|
+
`Stryker options were empty. Did you forget to export options from ${configFile}?`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return { ...maybeOptions } as PartialStrykerOptions;
|
|
145
|
+
} else {
|
|
146
|
+
this.log.fatal(
|
|
147
|
+
`Invalid config file. It is missing a default export. ${describeNamedExports()}\n${CONFIG_SYNTAX_HELP}`,
|
|
148
|
+
);
|
|
149
|
+
throw new ConfigReaderError(
|
|
150
|
+
'Config file must have a default export!',
|
|
151
|
+
configFile,
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
function describeNamedExports() {
|
|
155
|
+
const namedExports: string[] =
|
|
156
|
+
(typeof importedModule === 'object' &&
|
|
157
|
+
Object.keys(importedModule ?? {})) ||
|
|
158
|
+
[];
|
|
159
|
+
if (namedExports.length === 0) {
|
|
160
|
+
return "In fact, it didn't export anything.";
|
|
161
|
+
} else {
|
|
162
|
+
return `Found named export(s): ${new Intl.ListFormat('en').format(namedExports.map((name) => `"${name}"`))}.`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private async importJSConfigModule(configFile: string): Promise<unknown> {
|
|
169
|
+
try {
|
|
170
|
+
return await fileUtils.importModule(
|
|
171
|
+
pathToFileURL(path.resolve(configFile)).toString(),
|
|
172
|
+
);
|
|
173
|
+
} catch (err) {
|
|
174
|
+
throw new ConfigReaderError('Error during import', configFile, err);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private hasDefaultExport(
|
|
179
|
+
importedModule: unknown,
|
|
180
|
+
): importedModule is { default: unknown } {
|
|
181
|
+
return importedModule &&
|
|
182
|
+
typeof importedModule === 'object' &&
|
|
183
|
+
'default' in importedModule
|
|
184
|
+
? true
|
|
185
|
+
: false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export class ConfigReaderError extends ConfigError {
|
|
190
|
+
constructor(message: string, configFileName: string, cause?: unknown) {
|
|
191
|
+
super(`Invalid config file "${configFileName}". ${message}`, cause);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import { minimatch } from 'minimatch';
|
|
4
|
+
import { normalizeFileName } from '@stryker-mutator/util';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A helper class for matching files using the `disableTypeChecks` setting.
|
|
8
|
+
*/
|
|
9
|
+
export class FileMatcher {
|
|
10
|
+
private readonly pattern: boolean | string;
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
pattern: boolean | string,
|
|
14
|
+
private readonly allowHiddenFiles = true,
|
|
15
|
+
) {
|
|
16
|
+
if (typeof pattern === 'string') {
|
|
17
|
+
this.pattern = normalizeFileName(path.resolve(pattern));
|
|
18
|
+
} else if (pattern) {
|
|
19
|
+
this.pattern = '**/*.{js,ts,jsx,tsx,html,vue,mjs,mts,cts,cjs}';
|
|
20
|
+
} else {
|
|
21
|
+
this.pattern = pattern;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public matches(fileName: string): boolean {
|
|
26
|
+
if (typeof this.pattern === 'string') {
|
|
27
|
+
return minimatch(
|
|
28
|
+
normalizeFileName(path.resolve(fileName)),
|
|
29
|
+
this.pattern,
|
|
30
|
+
{ dot: this.allowHiddenFiles },
|
|
31
|
+
);
|
|
32
|
+
} else {
|
|
33
|
+
return this.pattern;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
|
|
2
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
3
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
4
|
+
|
|
5
|
+
import { coreTokens } from '../di/index.js';
|
|
6
|
+
|
|
7
|
+
export class MetaSchemaBuilder {
|
|
8
|
+
public static inject = tokens(
|
|
9
|
+
coreTokens.validationSchema,
|
|
10
|
+
commonTokens.logger,
|
|
11
|
+
);
|
|
12
|
+
constructor(
|
|
13
|
+
private readonly schema: JSONSchema7,
|
|
14
|
+
private readonly log: Logger,
|
|
15
|
+
) {}
|
|
16
|
+
|
|
17
|
+
public buildMetaSchema(
|
|
18
|
+
pluginSchemaContributions: Array<Record<string, unknown>>,
|
|
19
|
+
): JSONSchema7 {
|
|
20
|
+
this.log.debug(
|
|
21
|
+
'Contributing %s schemas from plugins to options validation.',
|
|
22
|
+
pluginSchemaContributions.length,
|
|
23
|
+
);
|
|
24
|
+
return mergedSchema(this.schema, pluginSchemaContributions);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function mergedSchema(
|
|
28
|
+
mainSchema: JSONSchema7,
|
|
29
|
+
additionalSchemas: JSONSchema7[],
|
|
30
|
+
): JSONSchema7 {
|
|
31
|
+
const schema = {
|
|
32
|
+
...mainSchema,
|
|
33
|
+
properties: {
|
|
34
|
+
...mainSchema.properties,
|
|
35
|
+
},
|
|
36
|
+
definitions: {
|
|
37
|
+
...mainSchema.definitions,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
Object.assign(
|
|
42
|
+
schema.properties,
|
|
43
|
+
...additionalSchemas.map((s) => s.properties),
|
|
44
|
+
);
|
|
45
|
+
Object.assign(
|
|
46
|
+
schema.definitions,
|
|
47
|
+
...additionalSchemas.map((s) => s.definitions),
|
|
48
|
+
);
|
|
49
|
+
return schema;
|
|
50
|
+
}
|