Socket
Socket
Sign inDemoInstall

@stryker-mutator/typescript-checker

Package Overview
Dependencies
3
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @stryker-mutator/typescript-checker

A typescript type checker plugin to be used in Stryker, the JavaScript mutation testing framework


Version published
Maintainers
4
Created

Changelog

Source

4.0.0-beta.4 (2020-08-29)

Bug Fixes

  • input files: support emojis in file names (#2430) (139f9f3)
  • input files: support emojis in file names (#2433) (b5feae2)

Features

  • api: rename test_runner2 -> test_runner (#2442) (4d3ae97)
  • jest-runner: switch mutants using env (#2416) (cad01ba)
  • karma-runner: force bail = true in all cases (ba928a1)
  • options: deprecate old stryker options (#2395) (7c637c8)
  • reporter-api: support mutation switching (67f1ed5)
  • test-runner: add nrOfTests metric (0eea448)
  • wct-runner: drop support for wct (#2440) (7c55424)

Performance Improvements

BREAKING CHANGES

  • api: Plugin creators should now use 'test_runner' instead of 'test_runner2'.
  • wct-runner: The @stryker-mutator/wct-runner package is dropped in Stryker 4.0. Please see https://github.com/stryker-mutator/stryker/issues/2386 for more details. Feel free to keep using @stryker-mutator/wct-runner@3 or start a community fork. Note that support for the web-component-tester itself is minimal, you might want to consider switching to a different test runner. Stryker still supports Mocha, Jest, Jasmine and Karma.
  • reporter-api: The onMutantTested and onAllMutantsTested methods on the Reporter api have changed

Readme

Source

NOTE: This readme describes a checker plugin set to release in Stryker v4. It is not usable yet! Please see the master branch for the current release of Stryker.

Mutation testing badge Build Status NPM Node version Slack Chat

Stryker

Typescript checker

A TypeScript type checker plugin for Stryker, the JavaScript TypeScript Mutation testing framework. This plugin enables type checking on mutants, so you won't have to waste time on mutants which results in a type error.

Features

👽 Type check each mutant. Invalid mutants will be marked as CompileError in your Stryker report.
🧒 Easy to setup, only your tsconfig.json file is needed.
🔢 Type check is done in-memory, no side effects on disk.
🎁 Support for both single typescript projects as well as projects with project references (--build mode).

Install

First, install Stryker itself (you can follow the quickstart on the website)

Next, install this package:

npm install --save-dev @stryker-mutator/typescript-checker

Configuring

You can configure the typescript checker in the stryker.conf.js (or stryker.conf.json) file.

// stryker.conf.json
{
  "checkers": ["typescript"],
  "tsconfigFile": "tsconfig.json"
}

tsconfigFile [string]

Default: 'tsconfig.json'

The path to your tsconfig. Project references are supported, --build mode will be enabled automatically when references are found in your tsconfig.json file.

Note: the following compiler options are always overridden by @stryker-mutator/typescript-checker to ovoid false positives. See issue 391 for more information on this

{
  "compilerOptions": {
    "allowUnreachableCode": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false
  }
}

Peer dependencies

The @stryker-mutator/typescript-checker package for stryker to enable typescript support. As such, you should make sure you have the correct versions of its dependencies installed:

  • typescript
  • @stryker-mutator/core

For the current versions, see the peerDependencies section in the package.json.

Troubleshooting

Load the plugin

In this plugin the @stryker-mutator/typescript-checker' must be loaded into Stryker. The easiest way to achieve this, is not have a plugins section in your config file. That way, all plugins starting with "@stryker-mutator/" will be loaded.

If you do decide to choose specific modules, don't forget to add "@stryker-mutator/typescript-checker" to the list of plugins to load.

FAQs

Last updated on 29 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc