@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,334 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DiscoverParams,
|
|
3
|
+
DiscoverResult,
|
|
4
|
+
ConfigureParams,
|
|
5
|
+
ConfigureResult,
|
|
6
|
+
MutationTestParams,
|
|
7
|
+
MutationTestResult,
|
|
8
|
+
DiscoveredFile,
|
|
9
|
+
FileRange,
|
|
10
|
+
} from 'mutation-server-protocol';
|
|
11
|
+
import {
|
|
12
|
+
JSONRPCClient,
|
|
13
|
+
JSONRPCServer,
|
|
14
|
+
JSONRPCServerAndClient,
|
|
15
|
+
} from 'json-rpc-2.0';
|
|
16
|
+
import net from 'net';
|
|
17
|
+
import { on } from 'events';
|
|
18
|
+
import { createInjector, Injector } from 'typed-inject';
|
|
19
|
+
import { PrepareExecutor } from './process/1-prepare-executor.js';
|
|
20
|
+
import { createInstrumenter } from '@stryker-mutator/instrumenter';
|
|
21
|
+
import { commonTokens, PluginKind } from '@stryker-mutator/api/plugin';
|
|
22
|
+
import { coreTokens } from './di/index.js';
|
|
23
|
+
import { objectUtils } from './utils/object-utils.js';
|
|
24
|
+
import { JsonRpcEventDeserializer } from './utils/json-rpc-event-deserializer.js';
|
|
25
|
+
import { Observable } from 'rxjs';
|
|
26
|
+
import {
|
|
27
|
+
LogLevel,
|
|
28
|
+
MutantResult,
|
|
29
|
+
PartialStrykerOptions,
|
|
30
|
+
} from '@stryker-mutator/api/core';
|
|
31
|
+
import { Reporter } from '@stryker-mutator/api/report';
|
|
32
|
+
import { Stryker } from './stryker.js';
|
|
33
|
+
import { promisify } from 'util';
|
|
34
|
+
import { normalizeReportFileName } from './reporters/mutation-test-report-helper.js';
|
|
35
|
+
import {
|
|
36
|
+
provideLogging,
|
|
37
|
+
provideLoggingBackend,
|
|
38
|
+
} from './logging/provide-logging.js';
|
|
39
|
+
import {
|
|
40
|
+
LoggingBackend,
|
|
41
|
+
LoggingServer,
|
|
42
|
+
LoggingServerAddress,
|
|
43
|
+
} from './logging/index.js';
|
|
44
|
+
import { Logger, LoggerFactoryMethod } from '@stryker-mutator/api/logging';
|
|
45
|
+
|
|
46
|
+
export const rpcMethods = Object.freeze({
|
|
47
|
+
configure: 'configure',
|
|
48
|
+
discover: 'discover',
|
|
49
|
+
mutationTest: 'mutationTest',
|
|
50
|
+
reportMutationTestProgressNotification: 'reportMutationTestProgress',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export interface StrykerServerOptions {
|
|
54
|
+
channel: 'stdio' | 'socket';
|
|
55
|
+
port?: number;
|
|
56
|
+
address?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const STRYKER_SERVER_NOT_STARTED =
|
|
60
|
+
"Stryker server isn't started yet, please call `start` first";
|
|
61
|
+
const STRYKER_SERVER_ALREADY_STARTED = 'Server already started';
|
|
62
|
+
/**
|
|
63
|
+
* An implementation of the mutation testing server protocol for StrykerJS.
|
|
64
|
+
* - Methods: `initialize`, `discover`, `mutationTest`
|
|
65
|
+
*
|
|
66
|
+
* @see https://github.com/stryker-mutator/editor-plugins/tree/main/packages/mutation-server-protocol#readme
|
|
67
|
+
*/
|
|
68
|
+
export class StrykerServer {
|
|
69
|
+
#server?: net.Server;
|
|
70
|
+
#configFilePath?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Keep track of the logging backend provider, so we can share the logging server between calls.
|
|
73
|
+
* New injectors for discover or mutation test tasks.
|
|
74
|
+
*/
|
|
75
|
+
#loggingBackendProvider?: Injector<{
|
|
76
|
+
getLogger: LoggerFactoryMethod;
|
|
77
|
+
logger: Logger;
|
|
78
|
+
loggingSink: LoggingBackend;
|
|
79
|
+
loggingServer: LoggingServer;
|
|
80
|
+
loggingServerAddress: LoggingServerAddress;
|
|
81
|
+
}>;
|
|
82
|
+
#rootInjector?: Injector;
|
|
83
|
+
#cliOptions;
|
|
84
|
+
#injectorFactory;
|
|
85
|
+
#serverOptions;
|
|
86
|
+
#abortController = new AbortController();
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param cliOptions The cli options.
|
|
90
|
+
* @param serverOptions The server options.
|
|
91
|
+
* @param injectorFactory The injector factory, for testing purposes only
|
|
92
|
+
*/
|
|
93
|
+
constructor(
|
|
94
|
+
serverOptions: StrykerServerOptions,
|
|
95
|
+
cliOptions: PartialStrykerOptions = {},
|
|
96
|
+
injectorFactory = createInjector,
|
|
97
|
+
) {
|
|
98
|
+
this.#cliOptions = cliOptions;
|
|
99
|
+
this.#injectorFactory = injectorFactory;
|
|
100
|
+
this.#serverOptions = serverOptions;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Starts the server and listens for incoming connections.
|
|
105
|
+
* @returns The port the server is listening on, or undefined if the server is listening on stdio.
|
|
106
|
+
*/
|
|
107
|
+
async start(): Promise<number | undefined> {
|
|
108
|
+
if (this.#rootInjector) {
|
|
109
|
+
throw new Error(STRYKER_SERVER_ALREADY_STARTED);
|
|
110
|
+
}
|
|
111
|
+
this.#rootInjector = this.#injectorFactory();
|
|
112
|
+
this.#loggingBackendProvider = provideLogging(
|
|
113
|
+
await provideLoggingBackend(this.#rootInjector, process.stderr),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
return this.#startChannel((inStream, outStream) => {
|
|
117
|
+
const deserializer = new JsonRpcEventDeserializer();
|
|
118
|
+
const rpc = new JSONRPCServerAndClient(
|
|
119
|
+
new JSONRPCServer(),
|
|
120
|
+
new JSONRPCClient((jsonRPCRequest) => {
|
|
121
|
+
const content = Buffer.from(JSON.stringify(jsonRPCRequest));
|
|
122
|
+
outStream.write(`Content-Length: ${content.byteLength}\r\n\r\n`);
|
|
123
|
+
outStream.write(content);
|
|
124
|
+
}),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
rpc.addMethod(rpcMethods.configure, this.configure.bind(this));
|
|
128
|
+
rpc.addMethod(rpcMethods.discover, this.discover.bind(this));
|
|
129
|
+
rpc.addMethod(rpcMethods.mutationTest, (params: MutationTestParams) => {
|
|
130
|
+
return new Promise<MutationTestResult>((resolve, reject) => {
|
|
131
|
+
this.mutationTest(params).subscribe({
|
|
132
|
+
next: (mutantResult) => {
|
|
133
|
+
const { fileName, ...mutant } = mutantResult;
|
|
134
|
+
rpc.client.notify(
|
|
135
|
+
rpcMethods.reportMutationTestProgressNotification,
|
|
136
|
+
{
|
|
137
|
+
files: {
|
|
138
|
+
[normalizeReportFileName(fileName)]: {
|
|
139
|
+
mutants: [mutant],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
} satisfies MutationTestResult,
|
|
143
|
+
);
|
|
144
|
+
},
|
|
145
|
+
error: reject,
|
|
146
|
+
complete: () => resolve({ files: {} }),
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
(async () => {
|
|
152
|
+
for await (const [data] of on(inStream, 'data', {
|
|
153
|
+
signal: this.#abortController.signal,
|
|
154
|
+
})) {
|
|
155
|
+
const events = deserializer.deserialize(data as Buffer);
|
|
156
|
+
for (const event of events) {
|
|
157
|
+
// https://www.npmjs.com/package/json-rpc-2.0#error-handling
|
|
158
|
+
// errors are already handled by JSON RPC, so we can ignore them here
|
|
159
|
+
void rpc.receiveAndSend(event);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
})().catch((error) => {
|
|
163
|
+
this.#loggingBackendProvider!.resolve(commonTokens.getLogger)(
|
|
164
|
+
StrykerServer.name,
|
|
165
|
+
).error(
|
|
166
|
+
'Error while listening for events on the JSON-RPC stream',
|
|
167
|
+
error,
|
|
168
|
+
);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Starts the communication channel, depending on the configured channel.
|
|
175
|
+
* @param connect A callback to connect the in- and out streams to the JSON-RPC server and client.
|
|
176
|
+
* @returns The port the server is listening on, or undefined if the server is listening on stdio.
|
|
177
|
+
*/
|
|
178
|
+
async #startChannel(
|
|
179
|
+
connect: (
|
|
180
|
+
inStream: NodeJS.ReadableStream,
|
|
181
|
+
outStream: NodeJS.WritableStream,
|
|
182
|
+
) => void,
|
|
183
|
+
) {
|
|
184
|
+
switch (this.#serverOptions.channel) {
|
|
185
|
+
case 'stdio':
|
|
186
|
+
connect(process.stdin, process.stdout);
|
|
187
|
+
return undefined;
|
|
188
|
+
case 'socket': {
|
|
189
|
+
this.#server = net.createServer((socket) => {
|
|
190
|
+
connect(socket, socket);
|
|
191
|
+
});
|
|
192
|
+
return new Promise<number>((res) => {
|
|
193
|
+
this.#server!.listen(
|
|
194
|
+
this.#serverOptions.port,
|
|
195
|
+
this.#serverOptions.address,
|
|
196
|
+
() => {
|
|
197
|
+
res((this.#server!.address() as net.AddressInfo).port);
|
|
198
|
+
},
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async stop(): Promise<void> {
|
|
206
|
+
this.#abortController.abort();
|
|
207
|
+
await this.#rootInjector?.dispose();
|
|
208
|
+
if (this.#server) {
|
|
209
|
+
await promisify(this.#server.close).bind(this.#server)();
|
|
210
|
+
this.#server = undefined;
|
|
211
|
+
}
|
|
212
|
+
this.#loggingBackendProvider = undefined;
|
|
213
|
+
this.#abortController = new AbortController();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
configure(configureParams: ConfigureParams): ConfigureResult {
|
|
217
|
+
this.#configFilePath = configureParams.configFilePath;
|
|
218
|
+
return { version: '0.4.0' };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async discover(discoverParams: DiscoverParams): Promise<DiscoverResult> {
|
|
222
|
+
if (!this.#loggingBackendProvider) {
|
|
223
|
+
throw new Error(STRYKER_SERVER_NOT_STARTED);
|
|
224
|
+
}
|
|
225
|
+
const discoverInjector = this.#loggingBackendProvider.provideValue(
|
|
226
|
+
coreTokens.reporterOverride,
|
|
227
|
+
undefined,
|
|
228
|
+
);
|
|
229
|
+
try {
|
|
230
|
+
const prepareExecutor = discoverInjector.injectClass(PrepareExecutor);
|
|
231
|
+
const inj = await prepareExecutor.execute({
|
|
232
|
+
cliOptions: {
|
|
233
|
+
...this.#cliOptions,
|
|
234
|
+
allowConsoleColors: false,
|
|
235
|
+
configFile: this.#configFilePath,
|
|
236
|
+
logLevel: LogLevel.Warning,
|
|
237
|
+
},
|
|
238
|
+
targetMutatePatterns: this.#filesToGlobPatterns(discoverParams.files),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
const instrumenter = inj.injectFunction(createInstrumenter);
|
|
242
|
+
const pluginCreator = inj.resolve(coreTokens.pluginCreator);
|
|
243
|
+
const options = inj.resolve(commonTokens.options);
|
|
244
|
+
const project = inj.resolve(coreTokens.project);
|
|
245
|
+
const filesToMutate = await Promise.all(
|
|
246
|
+
[...project.filesToMutate.values()].map((file) =>
|
|
247
|
+
file.toInstrumenterFile(),
|
|
248
|
+
),
|
|
249
|
+
);
|
|
250
|
+
const ignorers = options.ignorers.map((name) =>
|
|
251
|
+
pluginCreator.create(PluginKind.Ignore, name),
|
|
252
|
+
);
|
|
253
|
+
const instrumentResult = await instrumenter.instrument(filesToMutate, {
|
|
254
|
+
ignorers,
|
|
255
|
+
...options.mutator,
|
|
256
|
+
});
|
|
257
|
+
const mutants = instrumentResult.mutants.map((mutant) => ({
|
|
258
|
+
...mutant,
|
|
259
|
+
location: objectUtils.toSchemaLocation(mutant.location),
|
|
260
|
+
}));
|
|
261
|
+
const mutantsByFile = mutants.reduce((acc, mutant) => {
|
|
262
|
+
const { fileName, ...discoveredMutant } = mutant;
|
|
263
|
+
const normalizedFileName = normalizeReportFileName(fileName);
|
|
264
|
+
const file = acc.get(normalizedFileName) ?? { mutants: [] };
|
|
265
|
+
file.mutants.push(discoveredMutant);
|
|
266
|
+
acc.set(normalizedFileName, file);
|
|
267
|
+
return acc;
|
|
268
|
+
}, new Map<string, DiscoveredFile>());
|
|
269
|
+
return {
|
|
270
|
+
files: Object.fromEntries(mutantsByFile.entries()),
|
|
271
|
+
};
|
|
272
|
+
} finally {
|
|
273
|
+
await discoverInjector.dispose();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
public mutationTest(
|
|
278
|
+
mutationTestParams: MutationTestParams,
|
|
279
|
+
): Observable<MutantResult> {
|
|
280
|
+
return new Observable<MutantResult>((subscriber) => {
|
|
281
|
+
if (!this.#loggingBackendProvider) {
|
|
282
|
+
throw new Error(STRYKER_SERVER_NOT_STARTED);
|
|
283
|
+
}
|
|
284
|
+
const reporter: Reporter = {
|
|
285
|
+
onMutantTested(mutant) {
|
|
286
|
+
subscriber.next(mutant);
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const runInjector = this.#loggingBackendProvider.provideValue(
|
|
291
|
+
coreTokens.reporterOverride,
|
|
292
|
+
reporter,
|
|
293
|
+
);
|
|
294
|
+
let caughtError: unknown;
|
|
295
|
+
Stryker.run(runInjector, {
|
|
296
|
+
cliOptions: {
|
|
297
|
+
...this.#cliOptions,
|
|
298
|
+
allowConsoleColors: false,
|
|
299
|
+
configFile: this.#configFilePath,
|
|
300
|
+
logLevel: LogLevel.Warning,
|
|
301
|
+
},
|
|
302
|
+
targetMutatePatterns: this.#filesToGlobPatterns(
|
|
303
|
+
mutationTestParams.files,
|
|
304
|
+
),
|
|
305
|
+
})
|
|
306
|
+
.catch((error) => (caughtError = error))
|
|
307
|
+
.finally(() => {
|
|
308
|
+
runInjector
|
|
309
|
+
.dispose()
|
|
310
|
+
.catch((err) => {
|
|
311
|
+
console.error('Error during dispose', err);
|
|
312
|
+
})
|
|
313
|
+
.finally(() => {
|
|
314
|
+
if (caughtError) {
|
|
315
|
+
subscriber.error(caughtError);
|
|
316
|
+
} else {
|
|
317
|
+
subscriber.complete();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
#filesToGlobPatterns(files: FileRange[] | undefined): string[] | undefined {
|
|
325
|
+
return files?.map(
|
|
326
|
+
({ path, range }) =>
|
|
327
|
+
`${path.endsWith('/') ? `${path}**/*` : path}${range ? `:${posToMutationRange(range.start)}-${posToMutationRange(range.end)}` : ''}`,
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function posToMutationRange(pos: NonNullable<FileRange['range']>['start']) {
|
|
333
|
+
return `${pos.line}:${pos.column - 1}`; // MSP expects col-range to be exclusive, Stryker uses inclusive (https://github.com/stryker-mutator/editor-plugins/tree/main/packages/mutation-server-protocol#position-and-location-semantics)
|
|
334
|
+
}
|
package/src/stryker.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { MutantResult, PartialStrykerOptions } from '@stryker-mutator/api/core';
|
|
2
|
+
import { createInjector, Injector } from 'typed-inject';
|
|
3
|
+
import { commonTokens } from '@stryker-mutator/api/plugin';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
PrepareExecutor,
|
|
7
|
+
MutantInstrumenterExecutor,
|
|
8
|
+
DryRunExecutor,
|
|
9
|
+
MutationTestExecutor,
|
|
10
|
+
PrepareExecutorContext,
|
|
11
|
+
PrepareExecutorArgs,
|
|
12
|
+
} from './process/index.js';
|
|
13
|
+
import { coreTokens } from './di/index.js';
|
|
14
|
+
import { retrieveCause, ConfigError } from './errors.js';
|
|
15
|
+
import {
|
|
16
|
+
LoggingBackend,
|
|
17
|
+
provideLogging,
|
|
18
|
+
provideLoggingBackend,
|
|
19
|
+
} from './logging/index.js';
|
|
20
|
+
|
|
21
|
+
type MutationRunContext = PrepareExecutorContext & {
|
|
22
|
+
[coreTokens.loggingSink]: LoggingBackend;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The main Stryker class.
|
|
27
|
+
* It provides a single `runMutationTest()` function which runs mutation testing:
|
|
28
|
+
*/
|
|
29
|
+
export class Stryker {
|
|
30
|
+
/**
|
|
31
|
+
* @constructor
|
|
32
|
+
* @param cliOptions The cli options.
|
|
33
|
+
* @param injectorFactory The injector factory, for testing purposes only
|
|
34
|
+
*/
|
|
35
|
+
constructor(
|
|
36
|
+
private readonly cliOptions: PartialStrykerOptions,
|
|
37
|
+
private readonly injectorFactory = createInjector,
|
|
38
|
+
) {}
|
|
39
|
+
|
|
40
|
+
public async runMutationTest(): Promise<MutantResult[]> {
|
|
41
|
+
const rootInjector = this.injectorFactory();
|
|
42
|
+
try {
|
|
43
|
+
const prepareInjector = provideLogging(
|
|
44
|
+
await provideLoggingBackend(rootInjector, process.stdout),
|
|
45
|
+
).provideValue(coreTokens.reporterOverride, undefined);
|
|
46
|
+
return await Stryker.run(prepareInjector, {
|
|
47
|
+
cliOptions: this.cliOptions,
|
|
48
|
+
targetMutatePatterns: undefined,
|
|
49
|
+
});
|
|
50
|
+
} finally {
|
|
51
|
+
await rootInjector.dispose();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Does the actual mutation testing.
|
|
57
|
+
* Note: this is a public static method, so it can be reused from `StrykerServer`
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
static async run(
|
|
61
|
+
mutationRunInjector: Injector<MutationRunContext>,
|
|
62
|
+
args: PrepareExecutorArgs,
|
|
63
|
+
): Promise<MutantResult[]> {
|
|
64
|
+
try {
|
|
65
|
+
// 1. Prepare. Load Stryker configuration, load the input files
|
|
66
|
+
const prepareExecutor = mutationRunInjector.injectClass(PrepareExecutor);
|
|
67
|
+
const mutantInstrumenterInjector = await prepareExecutor.execute(args);
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
// 2. Mutate and instrument the files and write to the sandbox.
|
|
71
|
+
const mutantInstrumenter = mutantInstrumenterInjector.injectClass(
|
|
72
|
+
MutantInstrumenterExecutor,
|
|
73
|
+
);
|
|
74
|
+
const dryRunExecutorInjector = await mutantInstrumenter.execute();
|
|
75
|
+
|
|
76
|
+
// 3. Perform a 'dry run' (initial test run). Runs the tests without active mutants and collects coverage.
|
|
77
|
+
const dryRunExecutor =
|
|
78
|
+
dryRunExecutorInjector.injectClass(DryRunExecutor);
|
|
79
|
+
const mutationRunExecutorInjector = await dryRunExecutor.execute();
|
|
80
|
+
|
|
81
|
+
// 4. Actual mutation testing. Will check every mutant and if valid run it in an available test runner.
|
|
82
|
+
const mutationRunExecutor =
|
|
83
|
+
mutationRunExecutorInjector.injectClass(MutationTestExecutor);
|
|
84
|
+
const mutantResults = await mutationRunExecutor.execute();
|
|
85
|
+
|
|
86
|
+
return mutantResults;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
if (
|
|
89
|
+
mutantInstrumenterInjector.resolve(commonTokens.options)
|
|
90
|
+
.cleanTempDir !== 'always'
|
|
91
|
+
) {
|
|
92
|
+
const log = mutationRunInjector.resolve(commonTokens.getLogger)(
|
|
93
|
+
Stryker.name,
|
|
94
|
+
);
|
|
95
|
+
log.debug('Not removing the temp dir because an error occurred');
|
|
96
|
+
mutantInstrumenterInjector.resolve(
|
|
97
|
+
coreTokens.temporaryDirectory,
|
|
98
|
+
).removeDuringDisposal = false;
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const log = mutationRunInjector.resolve(commonTokens.getLogger)(
|
|
104
|
+
Stryker.name,
|
|
105
|
+
);
|
|
106
|
+
const cause = retrieveCause(error);
|
|
107
|
+
if (cause instanceof ConfigError) {
|
|
108
|
+
log.error(cause.message);
|
|
109
|
+
} else {
|
|
110
|
+
log.error('Unexpected error occurred while running Stryker', error);
|
|
111
|
+
log.info(
|
|
112
|
+
'This might be a known problem with a solution documented in our troubleshooting guide.',
|
|
113
|
+
);
|
|
114
|
+
log.info(
|
|
115
|
+
'You can find it at https://stryker-mutator.io/docs/stryker-js/troubleshooting/',
|
|
116
|
+
);
|
|
117
|
+
if (!log.isTraceEnabled()) {
|
|
118
|
+
log.info(
|
|
119
|
+
'Still having trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.',
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
throw cause;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { URL } from 'url';
|
|
2
|
+
|
|
3
|
+
import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
|
|
4
|
+
import { LoggerFactoryMethod } from '@stryker-mutator/api/logging';
|
|
5
|
+
import {
|
|
6
|
+
TestRunner,
|
|
7
|
+
DryRunOptions,
|
|
8
|
+
MutantRunOptions,
|
|
9
|
+
MutantRunResult,
|
|
10
|
+
DryRunResult,
|
|
11
|
+
TestRunnerCapabilities,
|
|
12
|
+
} from '@stryker-mutator/api/test-runner';
|
|
13
|
+
import { ExpirableTask } from '@stryker-mutator/util';
|
|
14
|
+
|
|
15
|
+
import { ChildProcessCrashedError } from '../child-proxy/child-process-crashed-error.js';
|
|
16
|
+
import { ChildProcessProxy } from '../child-proxy/child-process-proxy.js';
|
|
17
|
+
import { LoggingServerAddress } from '../logging/index.js';
|
|
18
|
+
|
|
19
|
+
import { IdGenerator } from '../child-proxy/id-generator.js';
|
|
20
|
+
|
|
21
|
+
import { ChildProcessTestRunnerWorker } from './child-process-test-runner-worker.js';
|
|
22
|
+
|
|
23
|
+
const MAX_WAIT_FOR_DISPOSE = 2000;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Runs the given test runner in a child process and forwards reports about test results
|
|
27
|
+
*/
|
|
28
|
+
export class ChildProcessTestRunnerProxy implements TestRunner {
|
|
29
|
+
private readonly worker: ChildProcessProxy<ChildProcessTestRunnerWorker>;
|
|
30
|
+
private readonly log;
|
|
31
|
+
constructor(
|
|
32
|
+
options: StrykerOptions,
|
|
33
|
+
fileDescriptions: FileDescriptions,
|
|
34
|
+
sandboxWorkingDirectory: string,
|
|
35
|
+
loggingServerAddress: LoggingServerAddress,
|
|
36
|
+
pluginModulePaths: readonly string[],
|
|
37
|
+
getLogger: LoggerFactoryMethod,
|
|
38
|
+
idGenerator: IdGenerator,
|
|
39
|
+
) {
|
|
40
|
+
this.log = getLogger(ChildProcessTestRunnerProxy.name);
|
|
41
|
+
this.worker = ChildProcessProxy.create(
|
|
42
|
+
new URL(
|
|
43
|
+
'./child-process-test-runner-worker.js',
|
|
44
|
+
import.meta.url,
|
|
45
|
+
).toString(),
|
|
46
|
+
loggingServerAddress,
|
|
47
|
+
options,
|
|
48
|
+
fileDescriptions,
|
|
49
|
+
pluginModulePaths,
|
|
50
|
+
sandboxWorkingDirectory,
|
|
51
|
+
ChildProcessTestRunnerWorker,
|
|
52
|
+
options.testRunnerNodeArgs,
|
|
53
|
+
getLogger,
|
|
54
|
+
idGenerator,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public capabilities(): Promise<TestRunnerCapabilities> {
|
|
59
|
+
return this.worker.proxy.capabilities();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public init(): Promise<void> {
|
|
63
|
+
return this.worker.proxy.init();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public dryRun(options: DryRunOptions): Promise<DryRunResult> {
|
|
67
|
+
return this.worker.proxy.dryRun(options);
|
|
68
|
+
}
|
|
69
|
+
public mutantRun(options: MutantRunOptions): Promise<MutantRunResult> {
|
|
70
|
+
return this.worker.proxy.mutantRun(options);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public async dispose(): Promise<void> {
|
|
74
|
+
await ExpirableTask.timeout(
|
|
75
|
+
// First let the inner test runner dispose
|
|
76
|
+
this.worker.proxy.dispose().catch((error: unknown) => {
|
|
77
|
+
// It's OK if the child process is already down.
|
|
78
|
+
if (!(error instanceof ChildProcessCrashedError)) {
|
|
79
|
+
// Handle error by logging it. We still want to kill the child process.
|
|
80
|
+
this.log.warn(
|
|
81
|
+
'An unexpected error occurred during test runner disposal. This might be worth looking into. Stryker will ignore this error.',
|
|
82
|
+
error,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}),
|
|
86
|
+
|
|
87
|
+
// ... but don't wait forever on that
|
|
88
|
+
MAX_WAIT_FOR_DISPOSE,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// After that, dispose the child process itself
|
|
92
|
+
await this.worker.dispose();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { StrykerOptions } from '@stryker-mutator/api/core';
|
|
2
|
+
import { commonTokens, PluginKind, tokens } from '@stryker-mutator/api/plugin';
|
|
3
|
+
import {
|
|
4
|
+
TestRunner,
|
|
5
|
+
DryRunOptions,
|
|
6
|
+
MutantRunOptions,
|
|
7
|
+
MutantRunResult,
|
|
8
|
+
DryRunResult,
|
|
9
|
+
DryRunStatus,
|
|
10
|
+
MutantRunStatus,
|
|
11
|
+
TestRunnerCapabilities,
|
|
12
|
+
} from '@stryker-mutator/api/test-runner';
|
|
13
|
+
import { errorToString } from '@stryker-mutator/util';
|
|
14
|
+
|
|
15
|
+
import { coreTokens, PluginCreator } from '../di/index.js';
|
|
16
|
+
|
|
17
|
+
export class ChildProcessTestRunnerWorker implements TestRunner {
|
|
18
|
+
private readonly underlyingTestRunner: TestRunner;
|
|
19
|
+
|
|
20
|
+
public static inject = tokens(commonTokens.options, coreTokens.pluginCreator);
|
|
21
|
+
constructor({ testRunner }: StrykerOptions, pluginCreator: PluginCreator) {
|
|
22
|
+
this.underlyingTestRunner = pluginCreator.create(
|
|
23
|
+
PluginKind.TestRunner,
|
|
24
|
+
testRunner,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async capabilities(): Promise<TestRunnerCapabilities> {
|
|
29
|
+
return this.underlyingTestRunner.capabilities();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public async init(): Promise<void> {
|
|
33
|
+
if (this.underlyingTestRunner.init) {
|
|
34
|
+
await this.underlyingTestRunner.init();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public async dispose(): Promise<void> {
|
|
39
|
+
if (this.underlyingTestRunner.dispose) {
|
|
40
|
+
await this.underlyingTestRunner.dispose();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public async dryRun(options: DryRunOptions): Promise<DryRunResult> {
|
|
45
|
+
const dryRunResult = await this.underlyingTestRunner.dryRun(options);
|
|
46
|
+
if (
|
|
47
|
+
dryRunResult.status === DryRunStatus.Complete &&
|
|
48
|
+
!dryRunResult.mutantCoverage &&
|
|
49
|
+
options.coverageAnalysis !== 'off'
|
|
50
|
+
) {
|
|
51
|
+
// @ts-expect-error global __mutantCoverage__ isn't statically typed
|
|
52
|
+
dryRunResult.mutantCoverage = global.__mutantCoverage__;
|
|
53
|
+
}
|
|
54
|
+
if (dryRunResult.status === DryRunStatus.Error) {
|
|
55
|
+
dryRunResult.errorMessage = errorToString(dryRunResult.errorMessage);
|
|
56
|
+
}
|
|
57
|
+
return dryRunResult;
|
|
58
|
+
}
|
|
59
|
+
public async mutantRun(options: MutantRunOptions): Promise<MutantRunResult> {
|
|
60
|
+
const result = await this.underlyingTestRunner.mutantRun(options);
|
|
61
|
+
if (result.status === MutantRunStatus.Error) {
|
|
62
|
+
result.errorMessage = errorToString(result.errorMessage);
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|