@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,36 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
|
|
3
|
+
import { MutationTestingPlanReadyEvent } from '@stryker-mutator/api/report';
|
|
4
|
+
|
|
5
|
+
import { ProgressKeeper } from './progress-keeper.js';
|
|
6
|
+
|
|
7
|
+
export class ProgressAppendOnlyReporter extends ProgressKeeper {
|
|
8
|
+
private intervalReference?: NodeJS.Timeout;
|
|
9
|
+
|
|
10
|
+
public onMutationTestingPlanReady(
|
|
11
|
+
event: MutationTestingPlanReadyEvent,
|
|
12
|
+
): void {
|
|
13
|
+
super.onMutationTestingPlanReady(event);
|
|
14
|
+
if (event.mutantPlans.length) {
|
|
15
|
+
this.intervalReference = setInterval(() => this.render(), 10000);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public onMutationTestReportReady(): void {
|
|
20
|
+
if (this.intervalReference) {
|
|
21
|
+
clearInterval(this.intervalReference);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private render() {
|
|
26
|
+
process.stdout.write(
|
|
27
|
+
`Mutation testing ${this.getPercentDone()} (elapsed: ${this.getElapsedTime()}, remaining: ${this.getEtc()}) ` +
|
|
28
|
+
`${this.progress.tested}/${this.progress.mutants} tested (${this.progress.survived} survived, ${this.progress.timedOut} timed out)` +
|
|
29
|
+
os.EOL,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private getPercentDone() {
|
|
34
|
+
return `${Math.floor((this.progress.ticks / this.progress.total) * 100)}%`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MutantResult,
|
|
3
|
+
MutantRunPlan,
|
|
4
|
+
MutantTestPlan,
|
|
5
|
+
PlanKind,
|
|
6
|
+
} from '@stryker-mutator/api/core';
|
|
7
|
+
import {
|
|
8
|
+
DryRunCompletedEvent,
|
|
9
|
+
MutationTestingPlanReadyEvent,
|
|
10
|
+
Reporter,
|
|
11
|
+
RunTiming,
|
|
12
|
+
} from '@stryker-mutator/api/report';
|
|
13
|
+
import { TestRunnerCapabilities } from '@stryker-mutator/api/test-runner';
|
|
14
|
+
|
|
15
|
+
import { Timer } from '../utils/timer.js';
|
|
16
|
+
|
|
17
|
+
export abstract class ProgressKeeper implements Reporter {
|
|
18
|
+
private timer!: Timer;
|
|
19
|
+
private timing!: RunTiming;
|
|
20
|
+
private capabilities!: TestRunnerCapabilities;
|
|
21
|
+
private ticksByMutantId!: Map<string, number>;
|
|
22
|
+
protected progress = {
|
|
23
|
+
survived: 0,
|
|
24
|
+
timedOut: 0,
|
|
25
|
+
tested: 0,
|
|
26
|
+
mutants: 0,
|
|
27
|
+
total: 0,
|
|
28
|
+
ticks: 0,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
public onDryRunCompleted({
|
|
32
|
+
timing,
|
|
33
|
+
capabilities,
|
|
34
|
+
}: DryRunCompletedEvent): void {
|
|
35
|
+
this.timing = timing;
|
|
36
|
+
this.capabilities = capabilities;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An event emitted when the mutant test plan is calculated.
|
|
41
|
+
* @param event The mutant test plan ready event
|
|
42
|
+
*/
|
|
43
|
+
public onMutationTestingPlanReady({
|
|
44
|
+
mutantPlans,
|
|
45
|
+
}: MutationTestingPlanReadyEvent): void {
|
|
46
|
+
this.timer = new Timer();
|
|
47
|
+
this.ticksByMutantId = new Map(
|
|
48
|
+
mutantPlans.filter(isRunPlan).map(({ netTime, mutant, runOptions }) => {
|
|
49
|
+
let ticks = netTime;
|
|
50
|
+
if (
|
|
51
|
+
!this.capabilities.reloadEnvironment &&
|
|
52
|
+
runOptions.reloadEnvironment
|
|
53
|
+
) {
|
|
54
|
+
ticks += this.timing.overhead;
|
|
55
|
+
}
|
|
56
|
+
return [mutant.id, ticks];
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
this.progress.mutants = this.ticksByMutantId.size;
|
|
60
|
+
this.progress.total = [...this.ticksByMutantId.values()].reduce(
|
|
61
|
+
(acc, n) => acc + n,
|
|
62
|
+
0,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public onMutantTested(result: MutantResult): number {
|
|
67
|
+
const ticks = this.ticksByMutantId.get(result.id);
|
|
68
|
+
if (ticks !== undefined) {
|
|
69
|
+
this.progress.tested++;
|
|
70
|
+
this.progress.ticks += this.ticksByMutantId.get(result.id) ?? 0;
|
|
71
|
+
if (result.status === 'Survived') {
|
|
72
|
+
this.progress.survived++;
|
|
73
|
+
}
|
|
74
|
+
if (result.status === 'Timeout') {
|
|
75
|
+
this.progress.timedOut++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return ticks ?? 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
protected getElapsedTime(): string {
|
|
82
|
+
return this.formatTime(this.timer.elapsedSeconds());
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
protected getEtc(): string {
|
|
86
|
+
const totalSecondsLeft = Math.floor(
|
|
87
|
+
(this.timer.elapsedSeconds() / this.progress.ticks) *
|
|
88
|
+
(this.progress.total - this.progress.ticks),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
if (isFinite(totalSecondsLeft) && totalSecondsLeft > 0) {
|
|
92
|
+
return this.formatTime(totalSecondsLeft);
|
|
93
|
+
} else {
|
|
94
|
+
return 'n/a';
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private formatTime(timeInSeconds: number) {
|
|
99
|
+
const hours = Math.floor(timeInSeconds / 3600);
|
|
100
|
+
|
|
101
|
+
const minutes = Math.floor((timeInSeconds % 3600) / 60);
|
|
102
|
+
|
|
103
|
+
return hours > 0 // conditional time formatting
|
|
104
|
+
? `~${hours}h ${minutes}m`
|
|
105
|
+
: minutes > 0
|
|
106
|
+
? `~${minutes}m`
|
|
107
|
+
: '<1m';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function isRunPlan(mutantPlan: MutantTestPlan): mutantPlan is MutantRunPlan {
|
|
112
|
+
return mutantPlan.plan === PlanKind.Run;
|
|
113
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MutantResult } from '@stryker-mutator/api/core';
|
|
2
|
+
import { MutationTestingPlanReadyEvent } from '@stryker-mutator/api/report';
|
|
3
|
+
|
|
4
|
+
import { progressBarWrapper } from './progress-bar.js';
|
|
5
|
+
import { ProgressKeeper } from './progress-keeper.js';
|
|
6
|
+
|
|
7
|
+
export class ProgressBarReporter extends ProgressKeeper {
|
|
8
|
+
private progressBar?: ProgressBar;
|
|
9
|
+
|
|
10
|
+
public onMutationTestingPlanReady(
|
|
11
|
+
event: MutationTestingPlanReadyEvent,
|
|
12
|
+
): void {
|
|
13
|
+
super.onMutationTestingPlanReady(event);
|
|
14
|
+
const progressBarContent =
|
|
15
|
+
'Mutation testing [:bar] :percent (elapsed: :et, remaining: :etc) :tested/:mutants Mutants tested (:survived survived, :timedOut timed out)';
|
|
16
|
+
|
|
17
|
+
this.progressBar = new progressBarWrapper.ProgressBar(progressBarContent, {
|
|
18
|
+
complete: '=',
|
|
19
|
+
incomplete: ' ',
|
|
20
|
+
stream: process.stdout,
|
|
21
|
+
total: this.progress.total,
|
|
22
|
+
width: 50,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public onMutantTested(result: MutantResult): number {
|
|
27
|
+
const ticks = super.onMutantTested(result);
|
|
28
|
+
|
|
29
|
+
const progressBarContent = {
|
|
30
|
+
...this.progress,
|
|
31
|
+
et: this.getElapsedTime(),
|
|
32
|
+
etc: this.getEtc(),
|
|
33
|
+
};
|
|
34
|
+
if (ticks) {
|
|
35
|
+
this.tick(ticks, progressBarContent);
|
|
36
|
+
} else {
|
|
37
|
+
this.render(progressBarContent);
|
|
38
|
+
}
|
|
39
|
+
return ticks;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private tick(ticks: number, tickObj: ProgressState): void {
|
|
43
|
+
this.progressBar?.tick(ticks, tickObj);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private render(renderObj: ProgressState): void {
|
|
47
|
+
if (this.progressBar?.total) {
|
|
48
|
+
this.progressBar.render(renderObj);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface ProgressState {
|
|
54
|
+
et: string;
|
|
55
|
+
etc: string;
|
|
56
|
+
survived: number;
|
|
57
|
+
timedOut: number;
|
|
58
|
+
tested: number;
|
|
59
|
+
mutants: number;
|
|
60
|
+
total: number;
|
|
61
|
+
ticks: number;
|
|
62
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { createReadStream, createWriteStream, promises as fs } from 'fs';
|
|
3
|
+
|
|
4
|
+
export const reporterUtil = {
|
|
5
|
+
copyFile(fromFilename: string, toFilename: string): Promise<void> {
|
|
6
|
+
return new Promise<void>((resolve, reject) => {
|
|
7
|
+
const readStream = createReadStream(fromFilename);
|
|
8
|
+
const writeStream = createWriteStream(toFilename);
|
|
9
|
+
readStream.on('error', reject);
|
|
10
|
+
writeStream.on('error', reject);
|
|
11
|
+
readStream.pipe(writeStream);
|
|
12
|
+
readStream.on('end', resolve);
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
async writeFile(fileName: string, content: string): Promise<void> {
|
|
17
|
+
await fs.mkdir(path.dirname(fileName), { recursive: true });
|
|
18
|
+
await fs.writeFile(fileName, content, 'utf8');
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tokens,
|
|
3
|
+
Injector,
|
|
4
|
+
commonTokens,
|
|
5
|
+
PluginContext,
|
|
6
|
+
} from '@stryker-mutator/api/plugin';
|
|
7
|
+
|
|
8
|
+
import { disableTypeChecks } from '@stryker-mutator/instrumenter';
|
|
9
|
+
|
|
10
|
+
import { coreTokens } from '../di/index.js';
|
|
11
|
+
|
|
12
|
+
import { TSConfigPreprocessor } from './ts-config-preprocessor.js';
|
|
13
|
+
import { FilePreprocessor } from './file-preprocessor.js';
|
|
14
|
+
import { MultiPreprocessor } from './multi-preprocessor.js';
|
|
15
|
+
import { DisableTypeChecksPreprocessor } from './disable-type-checks-preprocessor.js';
|
|
16
|
+
|
|
17
|
+
createPreprocessor.inject = tokens(commonTokens.injector);
|
|
18
|
+
export function createPreprocessor(
|
|
19
|
+
injector: Injector<PluginContext>,
|
|
20
|
+
): FilePreprocessor {
|
|
21
|
+
return new MultiPreprocessor([
|
|
22
|
+
injector
|
|
23
|
+
.provideValue(coreTokens.disableTypeChecksHelper, disableTypeChecks)
|
|
24
|
+
.injectClass(DisableTypeChecksPreprocessor),
|
|
25
|
+
injector.injectClass(TSConfigPreprocessor),
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
|
|
4
|
+
import { StrykerOptions } from '@stryker-mutator/api/core';
|
|
5
|
+
import type { disableTypeChecks } from '@stryker-mutator/instrumenter';
|
|
6
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
7
|
+
|
|
8
|
+
import { optionsPath } from '../utils/index.js';
|
|
9
|
+
import { coreTokens } from '../di/index.js';
|
|
10
|
+
import { objectUtils } from '../utils/object-utils.js';
|
|
11
|
+
import { FileMatcher } from '../config/index.js';
|
|
12
|
+
|
|
13
|
+
import { Project } from '../fs/project.js';
|
|
14
|
+
|
|
15
|
+
import { FilePreprocessor } from './file-preprocessor.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Disabled type checking by inserting `@ts-nocheck` atop TS/JS files and removing other @ts-xxx directives from comments:
|
|
19
|
+
* @see https://github.com/stryker-mutator/stryker-js/issues/2438
|
|
20
|
+
*/
|
|
21
|
+
export class DisableTypeChecksPreprocessor implements FilePreprocessor {
|
|
22
|
+
public static readonly inject = tokens(
|
|
23
|
+
commonTokens.logger,
|
|
24
|
+
commonTokens.options,
|
|
25
|
+
coreTokens.disableTypeChecksHelper,
|
|
26
|
+
);
|
|
27
|
+
constructor(
|
|
28
|
+
private readonly log: Logger,
|
|
29
|
+
private readonly options: StrykerOptions,
|
|
30
|
+
private readonly impl: typeof disableTypeChecks,
|
|
31
|
+
) {}
|
|
32
|
+
|
|
33
|
+
public async preprocess(project: Project): Promise<void> {
|
|
34
|
+
const matcher = new FileMatcher(this.options.disableTypeChecks);
|
|
35
|
+
let warningLogged = false;
|
|
36
|
+
await Promise.all(
|
|
37
|
+
objectUtils.map(project.files, async (file, name) => {
|
|
38
|
+
if (matcher.matches(path.resolve(name))) {
|
|
39
|
+
try {
|
|
40
|
+
const { content } = await this.impl(
|
|
41
|
+
await file.toInstrumenterFile(),
|
|
42
|
+
{ plugins: this.options.mutator.plugins },
|
|
43
|
+
);
|
|
44
|
+
file.setContent(content);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
if (
|
|
47
|
+
objectUtils.isWarningEnabled(
|
|
48
|
+
'preprocessorErrors',
|
|
49
|
+
this.options.warnings,
|
|
50
|
+
)
|
|
51
|
+
) {
|
|
52
|
+
warningLogged = true;
|
|
53
|
+
this.log.warn(
|
|
54
|
+
`Unable to disable type checking for file "${name}". Shouldn't type checking be disabled for this file? Consider configuring a more restrictive "${optionsPath(
|
|
55
|
+
'disableTypeChecks',
|
|
56
|
+
)}" settings (or turn it completely off with \`false\`)`,
|
|
57
|
+
err,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
if (warningLogged) {
|
|
65
|
+
this.log.warn(
|
|
66
|
+
`(disable "${optionsPath('warnings', 'preprocessorErrors')}" to ignore this warning`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Project } from '../fs/project.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A preprocessor changes files before writing them to the sandbox.
|
|
5
|
+
* Stuff like rewriting references tsconfig.json files or adding // @ts-nocheck
|
|
6
|
+
* This is a private api that we might want to open up in the future.
|
|
7
|
+
*/
|
|
8
|
+
export interface FilePreprocessor {
|
|
9
|
+
preprocess(files: Project): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Project } from '../fs/project.js';
|
|
2
|
+
|
|
3
|
+
import { FilePreprocessor } from './file-preprocessor.js';
|
|
4
|
+
|
|
5
|
+
export class MultiPreprocessor implements FilePreprocessor {
|
|
6
|
+
constructor(private readonly preprocessors: FilePreprocessor[]) {}
|
|
7
|
+
|
|
8
|
+
public async preprocess(project: Project): Promise<void> {
|
|
9
|
+
for (const preprocessor of this.preprocessors) {
|
|
10
|
+
await preprocessor.preprocess(project);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { execaCommand } from 'execa';
|
|
4
|
+
import { npmRunPathEnv } from 'npm-run-path';
|
|
5
|
+
import { StrykerOptions } from '@stryker-mutator/api/core';
|
|
6
|
+
import {
|
|
7
|
+
normalizeWhitespaces,
|
|
8
|
+
I,
|
|
9
|
+
isErrnoException,
|
|
10
|
+
} from '@stryker-mutator/util';
|
|
11
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
12
|
+
import { tokens, commonTokens, Disposable } from '@stryker-mutator/api/plugin';
|
|
13
|
+
|
|
14
|
+
import { TemporaryDirectory } from '../utils/temporary-directory.js';
|
|
15
|
+
import { fileUtils } from '../utils/file-utils.js';
|
|
16
|
+
import { coreTokens } from '../di/index.js';
|
|
17
|
+
import { UnexpectedExitHandler } from '../unexpected-exit-handler.js';
|
|
18
|
+
import { ProjectFile } from '../fs/index.js';
|
|
19
|
+
import { Project } from '../fs/project.js';
|
|
20
|
+
import { objectUtils } from '../utils/index.js';
|
|
21
|
+
|
|
22
|
+
export class Sandbox implements Disposable {
|
|
23
|
+
private readonly fileMap = new Map<string, string>();
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The working directory for this sandbox
|
|
27
|
+
* Either an actual sandbox directory, or the cwd when running in --inPlace mode
|
|
28
|
+
*/
|
|
29
|
+
public readonly workingDirectory: string;
|
|
30
|
+
/**11
|
|
31
|
+
* The backup directory when running in --inPlace mode
|
|
32
|
+
*/
|
|
33
|
+
private readonly backupDirectory: string = '';
|
|
34
|
+
|
|
35
|
+
public static readonly inject = tokens(
|
|
36
|
+
commonTokens.options,
|
|
37
|
+
commonTokens.logger,
|
|
38
|
+
coreTokens.temporaryDirectory,
|
|
39
|
+
coreTokens.project,
|
|
40
|
+
coreTokens.execa,
|
|
41
|
+
coreTokens.unexpectedExitRegistry,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param temporaryDirectory The sandbox dir or the backup dir when running in `--inPlace` mode
|
|
46
|
+
*/
|
|
47
|
+
constructor(
|
|
48
|
+
private readonly options: StrykerOptions,
|
|
49
|
+
private readonly log: Logger,
|
|
50
|
+
temporaryDirectory: I<TemporaryDirectory>,
|
|
51
|
+
private readonly project: Project,
|
|
52
|
+
private readonly execCommand: typeof execaCommand,
|
|
53
|
+
unexpectedExitHandler: I<UnexpectedExitHandler>,
|
|
54
|
+
) {
|
|
55
|
+
if (options.inPlace) {
|
|
56
|
+
this.workingDirectory = process.cwd();
|
|
57
|
+
this.backupDirectory = temporaryDirectory.path;
|
|
58
|
+
this.log.info(
|
|
59
|
+
'In place mode is enabled, Stryker will be overriding YOUR files. Find your backup at: %s',
|
|
60
|
+
path.relative(process.cwd(), this.backupDirectory),
|
|
61
|
+
);
|
|
62
|
+
unexpectedExitHandler.registerHandler(
|
|
63
|
+
this.dispose.bind(this, /* unexpected */ true),
|
|
64
|
+
);
|
|
65
|
+
} else {
|
|
66
|
+
this.workingDirectory = temporaryDirectory.path;
|
|
67
|
+
this.log.debug(
|
|
68
|
+
'Creating a sandbox for files in %s',
|
|
69
|
+
this.workingDirectory,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public async init(): Promise<void> {
|
|
75
|
+
await this.fillSandbox();
|
|
76
|
+
await this.runBuildCommand();
|
|
77
|
+
await this.symlinkNodeModulesIfNeeded();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public sandboxFileFor(fileName: string): string {
|
|
81
|
+
const sandboxFileName = this.fileMap.get(fileName);
|
|
82
|
+
if (sandboxFileName === undefined) {
|
|
83
|
+
throw new Error(`Cannot find sandbox file for ${fileName}`);
|
|
84
|
+
}
|
|
85
|
+
return sandboxFileName;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public originalFileFor(sandboxFileName: string): string {
|
|
89
|
+
return path
|
|
90
|
+
.resolve(sandboxFileName)
|
|
91
|
+
.replace(path.resolve(this.workingDirectory), process.cwd());
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private async fillSandbox(): Promise<void> {
|
|
95
|
+
await Promise.all(
|
|
96
|
+
objectUtils.map(this.project.files, (file, name) =>
|
|
97
|
+
this.sandboxFile(name, file),
|
|
98
|
+
),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private async runBuildCommand() {
|
|
103
|
+
if (this.options.buildCommand) {
|
|
104
|
+
const env = npmRunPathEnv();
|
|
105
|
+
this.log.info(
|
|
106
|
+
'Running build command "%s" in "%s".',
|
|
107
|
+
this.options.buildCommand,
|
|
108
|
+
this.workingDirectory,
|
|
109
|
+
);
|
|
110
|
+
this.log.debug('(using PATH: %s)', env.PATH);
|
|
111
|
+
await this.execCommand(this.options.buildCommand, {
|
|
112
|
+
cwd: this.workingDirectory,
|
|
113
|
+
env,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private async symlinkNodeModulesIfNeeded(): Promise<void> {
|
|
119
|
+
this.log.debug('Start symlink node_modules');
|
|
120
|
+
if (this.options.symlinkNodeModules && !this.options.inPlace) {
|
|
121
|
+
// TODO: Change with this.options.basePath when we have it
|
|
122
|
+
const basePath = process.cwd();
|
|
123
|
+
const nodeModulesList = await fileUtils.findNodeModulesList(
|
|
124
|
+
basePath,
|
|
125
|
+
this.options.tempDirName,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
if (nodeModulesList.length > 0) {
|
|
129
|
+
for (const nodeModules of nodeModulesList) {
|
|
130
|
+
this.log.debug(
|
|
131
|
+
`Create symlink from ${path.resolve(nodeModules)} to ${path.join(this.workingDirectory, nodeModules)}`,
|
|
132
|
+
);
|
|
133
|
+
await fileUtils
|
|
134
|
+
.symlinkJunction(
|
|
135
|
+
path.resolve(nodeModules),
|
|
136
|
+
path.join(this.workingDirectory, nodeModules),
|
|
137
|
+
)
|
|
138
|
+
.catch((error: unknown) => {
|
|
139
|
+
if (isErrnoException(error) && error.code === 'EEXIST') {
|
|
140
|
+
this.log.warn(
|
|
141
|
+
normalizeWhitespaces(`Could not symlink "${nodeModules}" in sandbox directory,
|
|
142
|
+
it is already created in the sandbox. Please remove the node_modules from your sandbox files.
|
|
143
|
+
Alternatively, set \`symlinkNodeModules\` to \`false\` to disable this warning.`),
|
|
144
|
+
);
|
|
145
|
+
} else {
|
|
146
|
+
this.log.warn(
|
|
147
|
+
`Unexpected error while trying to symlink "${nodeModules}" in sandbox directory.`,
|
|
148
|
+
error,
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
this.log.debug(
|
|
155
|
+
`Could not find a node_modules folder to symlink into the sandbox directory. Search "${basePath}" and its parent directories`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Sandboxes a file (writes it to the sandbox). Either in-place, or an actual sandbox directory.
|
|
163
|
+
* @param name The name of the file
|
|
164
|
+
* @param file The file reference
|
|
165
|
+
*/
|
|
166
|
+
private async sandboxFile(name: string, file: ProjectFile): Promise<void> {
|
|
167
|
+
if (this.options.inPlace) {
|
|
168
|
+
if (file.hasChanges) {
|
|
169
|
+
// File is changed (either mutated or by a preprocessor), make a backup and replace in-place
|
|
170
|
+
const backupFileName = await file.backupTo(this.backupDirectory);
|
|
171
|
+
this.log.debug('Stored backup file at %s', backupFileName);
|
|
172
|
+
await file.writeInPlace();
|
|
173
|
+
}
|
|
174
|
+
this.fileMap.set(name, name);
|
|
175
|
+
} else {
|
|
176
|
+
const targetFileName = await file.writeToSandbox(this.workingDirectory);
|
|
177
|
+
this.fileMap.set(name, targetFileName);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
public dispose(unexpected = false): void {
|
|
182
|
+
if (this.backupDirectory) {
|
|
183
|
+
if (unexpected) {
|
|
184
|
+
console.error(
|
|
185
|
+
`Detecting unexpected exit, recovering original files from ${path.relative(process.cwd(), this.backupDirectory)}`,
|
|
186
|
+
);
|
|
187
|
+
} else {
|
|
188
|
+
this.log.info(
|
|
189
|
+
`Resetting your original files from ${path.relative(process.cwd(), this.backupDirectory)}.`,
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
fileUtils.moveDirectoryRecursiveSync(
|
|
193
|
+
this.backupDirectory,
|
|
194
|
+
this.workingDirectory,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|