@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,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MutantResult,
|
|
3
|
+
schema,
|
|
4
|
+
StrykerOptions,
|
|
5
|
+
} from '@stryker-mutator/api/core';
|
|
6
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
7
|
+
import { commonTokens, PluginKind } from '@stryker-mutator/api/plugin';
|
|
8
|
+
import {
|
|
9
|
+
DryRunCompletedEvent,
|
|
10
|
+
MutationTestingPlanReadyEvent,
|
|
11
|
+
Reporter,
|
|
12
|
+
} from '@stryker-mutator/api/report';
|
|
13
|
+
import { MutationTestMetricsResult } from 'mutation-testing-metrics';
|
|
14
|
+
import { tokens } from 'typed-inject';
|
|
15
|
+
|
|
16
|
+
import { coreTokens, PluginCreator } from '../di/index.js';
|
|
17
|
+
|
|
18
|
+
import { StrictReporter } from './strict-reporter.js';
|
|
19
|
+
|
|
20
|
+
export class BroadcastReporter implements StrictReporter {
|
|
21
|
+
public static readonly inject = tokens(
|
|
22
|
+
commonTokens.options,
|
|
23
|
+
coreTokens.pluginCreator,
|
|
24
|
+
commonTokens.logger,
|
|
25
|
+
coreTokens.reporterOverride,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
public readonly reporters: Record<string, Reporter>;
|
|
29
|
+
constructor(
|
|
30
|
+
private readonly options: StrykerOptions,
|
|
31
|
+
private readonly pluginCreator: PluginCreator,
|
|
32
|
+
private readonly log: Logger,
|
|
33
|
+
private readonly reporterOverride: Reporter | undefined,
|
|
34
|
+
) {
|
|
35
|
+
this.reporters = {};
|
|
36
|
+
if (this.reporterOverride) {
|
|
37
|
+
this.reporters['in-memory'] = this.reporterOverride;
|
|
38
|
+
} else {
|
|
39
|
+
this.options.reporters.forEach((reporterName) =>
|
|
40
|
+
this.createReporter(reporterName),
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
this.logAboutReporters();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private createReporter(reporterName: string): void {
|
|
47
|
+
if (reporterName === 'progress' && !process.stdout.isTTY) {
|
|
48
|
+
this.log.info(
|
|
49
|
+
'Detected that current console does not support the "progress" reporter, downgrading to "progress-append-only" reporter',
|
|
50
|
+
);
|
|
51
|
+
reporterName = 'progress-append-only';
|
|
52
|
+
}
|
|
53
|
+
this.reporters[reporterName] = this.pluginCreator.create(
|
|
54
|
+
PluginKind.Reporter,
|
|
55
|
+
reporterName,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private logAboutReporters(): void {
|
|
60
|
+
const reporterNames = Object.keys(this.reporters);
|
|
61
|
+
if (reporterNames.length) {
|
|
62
|
+
if (this.log.isDebugEnabled()) {
|
|
63
|
+
this.log.debug(
|
|
64
|
+
`Broadcasting to reporters ${JSON.stringify(reporterNames)}`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
this.log.warn(
|
|
69
|
+
"No reporter configured. Please configure one or more reporters in the (for example: reporters: ['progress'])",
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private broadcast<TMethod extends keyof Reporter>(
|
|
75
|
+
methodName: TMethod,
|
|
76
|
+
...eventArgs: Parameters<Required<Reporter>[TMethod]>
|
|
77
|
+
): Promise<void[]> {
|
|
78
|
+
return Promise.all(
|
|
79
|
+
Object.entries(this.reporters).map(async ([reporterName, reporter]) => {
|
|
80
|
+
if (reporter[methodName]) {
|
|
81
|
+
try {
|
|
82
|
+
await (
|
|
83
|
+
reporter[methodName] as (
|
|
84
|
+
...args: Parameters<Required<Reporter>[TMethod]>
|
|
85
|
+
) => Promise<void> | void
|
|
86
|
+
)(...eventArgs);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
this.handleError(error, methodName, reporterName);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public onDryRunCompleted(event: DryRunCompletedEvent): void {
|
|
96
|
+
void this.broadcast('onDryRunCompleted', event);
|
|
97
|
+
}
|
|
98
|
+
public onMutationTestingPlanReady(
|
|
99
|
+
event: MutationTestingPlanReadyEvent,
|
|
100
|
+
): void {
|
|
101
|
+
void this.broadcast('onMutationTestingPlanReady', event);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public onMutantTested(result: MutantResult): void {
|
|
105
|
+
void this.broadcast('onMutantTested', result);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public onMutationTestReportReady(
|
|
109
|
+
report: schema.MutationTestResult,
|
|
110
|
+
metrics: MutationTestMetricsResult,
|
|
111
|
+
): void {
|
|
112
|
+
void this.broadcast('onMutationTestReportReady', report, metrics);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public async wrapUp(): Promise<void> {
|
|
116
|
+
await this.broadcast('wrapUp');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private handleError(
|
|
120
|
+
error: unknown,
|
|
121
|
+
methodName: string,
|
|
122
|
+
reporterName: string,
|
|
123
|
+
) {
|
|
124
|
+
this.log.error(
|
|
125
|
+
`An error occurred during '${methodName}' on reporter '${reporterName}'.`,
|
|
126
|
+
error,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { objectUtils } from '../../utils/object-utils.js';
|
|
2
|
+
|
|
3
|
+
import { CIProvider } from './provider.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
|
|
7
|
+
*/
|
|
8
|
+
export class CircleProvider implements CIProvider {
|
|
9
|
+
public determineProject(): string {
|
|
10
|
+
return `${this.determineProvider()}/${this.determineRepository()}`;
|
|
11
|
+
}
|
|
12
|
+
public determineVersion(): string | undefined {
|
|
13
|
+
return (
|
|
14
|
+
objectUtils.undefinedEmptyString(
|
|
15
|
+
objectUtils.getEnvironmentVariable('CIRCLE_PR_NUMBER'),
|
|
16
|
+
) ??
|
|
17
|
+
objectUtils.undefinedEmptyString(
|
|
18
|
+
objectUtils.getEnvironmentVariable('CIRCLE_BRANCH'),
|
|
19
|
+
) ??
|
|
20
|
+
objectUtils.undefinedEmptyString(
|
|
21
|
+
objectUtils.getEnvironmentVariable('CIRCLE_TAG'),
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private determineRepository() {
|
|
27
|
+
const username = objectUtils.getEnvironmentVariableOrThrow(
|
|
28
|
+
'CIRCLE_PROJECT_USERNAME',
|
|
29
|
+
);
|
|
30
|
+
const repoName = objectUtils.getEnvironmentVariableOrThrow(
|
|
31
|
+
'CIRCLE_PROJECT_REPONAME',
|
|
32
|
+
);
|
|
33
|
+
return `${username}/${repoName}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private determineProvider() {
|
|
37
|
+
// Repo url can be in 2 forms:
|
|
38
|
+
// - 'git@github.com:company/repo.git'
|
|
39
|
+
// - 'https://github.com/company/repo'
|
|
40
|
+
// See https://discuss.circleci.com/t/circle-repository-url-changed-format-in-v2/15273
|
|
41
|
+
const repoUrl = objectUtils.getEnvironmentVariableOrThrow(
|
|
42
|
+
'CIRCLE_REPOSITORY_URL',
|
|
43
|
+
);
|
|
44
|
+
if (repoUrl.startsWith('git@')) {
|
|
45
|
+
return repoUrl.substr(4).split(':')[0];
|
|
46
|
+
} else {
|
|
47
|
+
return repoUrl.split('//')[1].split('/')[0];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { objectUtils } from '../../utils/object-utils.js';
|
|
2
|
+
|
|
3
|
+
import { CIProvider } from './provider.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables
|
|
7
|
+
*/
|
|
8
|
+
export class GithubActionsCIProvider implements CIProvider {
|
|
9
|
+
public determineProject(): string {
|
|
10
|
+
return `github.com/${objectUtils.getEnvironmentVariableOrThrow('GITHUB_REPOSITORY')}`;
|
|
11
|
+
}
|
|
12
|
+
public determineVersion(): string {
|
|
13
|
+
const rawRef = objectUtils.getEnvironmentVariableOrThrow('GITHUB_REF');
|
|
14
|
+
// rawRef will be in the form "refs/pull/:prNumber/merge" or "refs/heads/feat/branch-1"
|
|
15
|
+
const [, type, ...name] = rawRef.split('/');
|
|
16
|
+
if (type === 'pull') {
|
|
17
|
+
return `PR-${name[0]}`;
|
|
18
|
+
} else {
|
|
19
|
+
return name.join('/');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { objectUtils } from '../../utils/object-utils.js';
|
|
2
|
+
|
|
3
|
+
import { CircleProvider } from './circle-provider.js';
|
|
4
|
+
import { TravisProvider } from './travis-provider.js';
|
|
5
|
+
import { GithubActionsCIProvider } from './github-actions-provider.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents an object that can provide information about a CI/CD provider.
|
|
9
|
+
*/
|
|
10
|
+
export interface CIProvider {
|
|
11
|
+
/**
|
|
12
|
+
* Determine the repository slug, including the git provider. I.E: github.com/stryker-mutator/stryker or bitbucket.org/org/name.
|
|
13
|
+
*/
|
|
14
|
+
determineProject(): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Determine the current version. I.e. branch name, git sha, or tag name
|
|
17
|
+
*/
|
|
18
|
+
determineVersion(): string | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Return an appropriate instance of CiProvider.
|
|
23
|
+
* @returns An instance of CiProvider, or `null` if it appears Stryker is not running in a CI/CD environment.
|
|
24
|
+
*/
|
|
25
|
+
export function determineCIProvider():
|
|
26
|
+
| CircleProvider
|
|
27
|
+
| GithubActionsCIProvider
|
|
28
|
+
| TravisProvider
|
|
29
|
+
| null {
|
|
30
|
+
// By far the coolest env. variable from all those listed at
|
|
31
|
+
// https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
|
|
32
|
+
if (objectUtils.getEnvironmentVariable('HAS_JOSH_K_SEAL_OF_APPROVAL')) {
|
|
33
|
+
return new TravisProvider();
|
|
34
|
+
} else if (objectUtils.getEnvironmentVariable('CIRCLECI')) {
|
|
35
|
+
return new CircleProvider();
|
|
36
|
+
} else if (objectUtils.getEnvironmentVariable('GITHUB_ACTION')) {
|
|
37
|
+
return new GithubActionsCIProvider();
|
|
38
|
+
}
|
|
39
|
+
// TODO: Add vsts and gitlab CI
|
|
40
|
+
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { objectUtils } from '../../utils/object-utils.js';
|
|
2
|
+
|
|
3
|
+
import { CIProvider } from './provider.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* See https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
|
7
|
+
*/
|
|
8
|
+
export class TravisProvider implements CIProvider {
|
|
9
|
+
public determineProject(): string | undefined {
|
|
10
|
+
const slug = objectUtils.getEnvironmentVariable('TRAVIS_REPO_SLUG');
|
|
11
|
+
if (slug) {
|
|
12
|
+
return `github.com/${slug}`;
|
|
13
|
+
} else {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
public determineVersion(): string | undefined {
|
|
18
|
+
return (
|
|
19
|
+
objectUtils.undefinedEmptyString(
|
|
20
|
+
objectUtils.getEnvironmentVariable('TRAVIS_PULL_REQUEST_BRANCH'),
|
|
21
|
+
) ?? objectUtils.getEnvironmentVariable('TRAVIS_BRANCH')
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
|
|
3
|
+
import chalk, { Color } from 'chalk';
|
|
4
|
+
import { schema, Position, StrykerOptions } from '@stryker-mutator/api/core';
|
|
5
|
+
import { Logger } from '@stryker-mutator/api/logging';
|
|
6
|
+
import { commonTokens } from '@stryker-mutator/api/plugin';
|
|
7
|
+
import { Reporter } from '@stryker-mutator/api/report';
|
|
8
|
+
import {
|
|
9
|
+
MetricsResult,
|
|
10
|
+
MutantModel,
|
|
11
|
+
TestModel,
|
|
12
|
+
MutationTestMetricsResult,
|
|
13
|
+
TestFileModel,
|
|
14
|
+
TestMetrics,
|
|
15
|
+
TestStatus,
|
|
16
|
+
} from 'mutation-testing-metrics';
|
|
17
|
+
import { tokens } from 'typed-inject';
|
|
18
|
+
|
|
19
|
+
import { getEmojiForStatus, plural } from '../utils/string-utils.js';
|
|
20
|
+
|
|
21
|
+
import { ClearTextScoreTable } from './clear-text-score-table.js';
|
|
22
|
+
|
|
23
|
+
export class ClearTextReporter implements Reporter {
|
|
24
|
+
public static inject = tokens(commonTokens.logger, commonTokens.options);
|
|
25
|
+
constructor(
|
|
26
|
+
private readonly log: Logger,
|
|
27
|
+
private readonly options: StrykerOptions,
|
|
28
|
+
) {
|
|
29
|
+
this.configConsoleColor();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private readonly out: NodeJS.WritableStream = process.stdout;
|
|
33
|
+
|
|
34
|
+
private readonly writeLine = (output?: string) => {
|
|
35
|
+
this.out.write(`${output ?? ''}${os.EOL}`);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
private readonly writeDebugLine = (input: string) => {
|
|
39
|
+
this.log.debug(input);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
private configConsoleColor() {
|
|
43
|
+
if (!this.options.allowConsoleColors) {
|
|
44
|
+
chalk.level = 0; // All colors disabled
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public onMutationTestReportReady(
|
|
49
|
+
_report: schema.MutationTestResult,
|
|
50
|
+
metrics: MutationTestMetricsResult,
|
|
51
|
+
): void {
|
|
52
|
+
this.writeLine();
|
|
53
|
+
|
|
54
|
+
if (this.options.clearTextReporter.reportTests) {
|
|
55
|
+
this.reportTests(metrics);
|
|
56
|
+
}
|
|
57
|
+
if (this.options.clearTextReporter.reportMutants) {
|
|
58
|
+
this.reportMutants(metrics);
|
|
59
|
+
}
|
|
60
|
+
if (
|
|
61
|
+
this.options.clearTextReporter.reportScoreTable &&
|
|
62
|
+
(!this.options.clearTextReporter.skipFull ||
|
|
63
|
+
metrics.systemUnderTestMetrics.childResults.some(
|
|
64
|
+
(x) => x.metrics.mutationScore !== 100,
|
|
65
|
+
))
|
|
66
|
+
) {
|
|
67
|
+
this.writeLine(
|
|
68
|
+
new ClearTextScoreTable(
|
|
69
|
+
metrics.systemUnderTestMetrics,
|
|
70
|
+
this.options,
|
|
71
|
+
).draw(),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private reportTests(metrics: MutationTestMetricsResult) {
|
|
77
|
+
function indent(depth: number) {
|
|
78
|
+
return new Array(depth).fill(' ').join('');
|
|
79
|
+
}
|
|
80
|
+
const formatTestLine = (test: TestModel, state: string): string => {
|
|
81
|
+
return `${this.color('grey', `${test.name}${test.location ? ` [line ${test.location.start.line}]` : ''}`)} (${state})`;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
if (metrics.testMetrics) {
|
|
85
|
+
const reportTests = (
|
|
86
|
+
currentResult: MetricsResult<TestFileModel, TestMetrics>,
|
|
87
|
+
depth = 0,
|
|
88
|
+
) => {
|
|
89
|
+
const nameParts: string[] = [currentResult.name];
|
|
90
|
+
while (!currentResult.file && currentResult.childResults.length === 1) {
|
|
91
|
+
[currentResult] = currentResult.childResults;
|
|
92
|
+
nameParts.push(currentResult.name);
|
|
93
|
+
}
|
|
94
|
+
this.writeLine(`${indent(depth)}${nameParts.join('/')}`);
|
|
95
|
+
currentResult.file?.tests.forEach((test) => {
|
|
96
|
+
switch (test.status) {
|
|
97
|
+
case TestStatus.Killing:
|
|
98
|
+
this.writeLine(
|
|
99
|
+
`${indent(depth + 1)}${this.color('greenBright', '✓')} ${formatTestLine(test, `killed ${test.killedMutants?.length}`)}`,
|
|
100
|
+
);
|
|
101
|
+
break;
|
|
102
|
+
case TestStatus.Covering:
|
|
103
|
+
this.writeLine(
|
|
104
|
+
`${indent(depth + 1)}${this.color('blueBright', '~')} ${formatTestLine(test, `covered ${test.coveredMutants?.length}`)}`,
|
|
105
|
+
);
|
|
106
|
+
break;
|
|
107
|
+
case TestStatus.NotCovering:
|
|
108
|
+
this.writeLine(
|
|
109
|
+
`${indent(depth + 1)}${this.color('redBright', '✘')} ${formatTestLine(test, 'covered 0')}`,
|
|
110
|
+
);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
currentResult.childResults.forEach((childResult) =>
|
|
115
|
+
reportTests(childResult, depth + 1),
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
reportTests(metrics.testMetrics);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private reportMutants({
|
|
123
|
+
systemUnderTestMetrics,
|
|
124
|
+
}: MutationTestMetricsResult): void {
|
|
125
|
+
this.writeLine();
|
|
126
|
+
let totalTests = 0;
|
|
127
|
+
|
|
128
|
+
const reportMutants = (metrics: MetricsResult[]) => {
|
|
129
|
+
metrics.forEach((child) => {
|
|
130
|
+
child.file?.mutants.forEach((result) => {
|
|
131
|
+
totalTests += result.testsCompleted ?? 0;
|
|
132
|
+
switch (result.status) {
|
|
133
|
+
case 'Killed':
|
|
134
|
+
case 'Timeout':
|
|
135
|
+
case 'RuntimeError':
|
|
136
|
+
case 'CompileError':
|
|
137
|
+
this.reportMutantResult(result, this.writeDebugLine);
|
|
138
|
+
break;
|
|
139
|
+
case 'Survived':
|
|
140
|
+
case 'NoCoverage':
|
|
141
|
+
this.reportMutantResult(result, this.writeLine);
|
|
142
|
+
break;
|
|
143
|
+
default:
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
reportMutants(child.childResults);
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
reportMutants(systemUnderTestMetrics.childResults);
|
|
150
|
+
this.writeLine(
|
|
151
|
+
`Ran ${(totalTests / systemUnderTestMetrics.metrics.totalMutants).toFixed(2)} tests per mutant on average.`,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private statusLabel(mutant: MutantModel): string {
|
|
156
|
+
const { status } = mutant;
|
|
157
|
+
return this.options.clearTextReporter.allowEmojis
|
|
158
|
+
? `${getEmojiForStatus(status)} ${status}`
|
|
159
|
+
: status.toString();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private reportMutantResult(
|
|
163
|
+
result: MutantModel,
|
|
164
|
+
logImplementation: (input: string) => void,
|
|
165
|
+
): void {
|
|
166
|
+
logImplementation(`[${this.statusLabel(result)}] ${result.mutatorName}`);
|
|
167
|
+
logImplementation(
|
|
168
|
+
this.colorSourceFileAndLocation(result.fileName, result.location.start),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
result
|
|
172
|
+
.getOriginalLines()
|
|
173
|
+
.split('\n')
|
|
174
|
+
.filter(Boolean)
|
|
175
|
+
.forEach((line) => {
|
|
176
|
+
logImplementation(chalk.red('- ' + line));
|
|
177
|
+
});
|
|
178
|
+
result
|
|
179
|
+
.getMutatedLines()
|
|
180
|
+
.split('\n')
|
|
181
|
+
.filter(Boolean)
|
|
182
|
+
.forEach((line) => {
|
|
183
|
+
logImplementation(chalk.green('+ ' + line));
|
|
184
|
+
});
|
|
185
|
+
if (result.status === 'Survived') {
|
|
186
|
+
if (result.static) {
|
|
187
|
+
logImplementation('Ran all tests for this mutant.');
|
|
188
|
+
} else if (result.coveredByTests) {
|
|
189
|
+
this.logExecutedTests(result.coveredByTests, logImplementation);
|
|
190
|
+
}
|
|
191
|
+
} else if (result.status === 'Killed' && result.killedByTests?.length) {
|
|
192
|
+
logImplementation(`Killed by: ${result.killedByTests[0].name}`);
|
|
193
|
+
} else if (
|
|
194
|
+
result.status === 'RuntimeError' ||
|
|
195
|
+
result.status === 'CompileError'
|
|
196
|
+
) {
|
|
197
|
+
logImplementation(`Error message: ${result.statusReason}`);
|
|
198
|
+
}
|
|
199
|
+
logImplementation('');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
private colorSourceFileAndLocation(
|
|
203
|
+
fileName: string,
|
|
204
|
+
position: Position,
|
|
205
|
+
): string {
|
|
206
|
+
return [
|
|
207
|
+
this.color('cyan', fileName),
|
|
208
|
+
this.color('yellow', position.line),
|
|
209
|
+
this.color('yellow', position.column),
|
|
210
|
+
].join(':');
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
private color(color: Color, ...text: unknown[]) {
|
|
214
|
+
if (this.options.clearTextReporter.allowColor) {
|
|
215
|
+
return chalk[color](...text);
|
|
216
|
+
}
|
|
217
|
+
return text.join('');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
private logExecutedTests(
|
|
221
|
+
tests: TestModel[],
|
|
222
|
+
logImplementation: (input: string) => void,
|
|
223
|
+
) {
|
|
224
|
+
if (!this.options.clearTextReporter.logTests) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const testCount = Math.min(
|
|
229
|
+
this.options.clearTextReporter.maxTestsToLog,
|
|
230
|
+
tests.length,
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
if (testCount > 0) {
|
|
234
|
+
logImplementation('Tests ran:');
|
|
235
|
+
tests.slice(0, testCount).forEach((test) => {
|
|
236
|
+
logImplementation(` ${test.name}`);
|
|
237
|
+
});
|
|
238
|
+
const diff = tests.length - this.options.clearTextReporter.maxTestsToLog;
|
|
239
|
+
if (diff > 0) {
|
|
240
|
+
logImplementation(` and ${diff} more test${plural(diff)}!`);
|
|
241
|
+
}
|
|
242
|
+
logImplementation('');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|