npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@d-es-ign/stryker-js-grunt-stryker

v9.6.3

Published

Grunt plugin for the mutation testing framework 'stryker'

Downloads

41

Readme

Build Status NPM Node version Slack Chat

Grunt-stryker

Fork notice

This project is a fork of the corresponding @stryker-mutator package/repository. Maintenance here is intentionally limited, and this fork only exists while https://github.com/stryker-mutator/stryker-js/pull/5866 has not been accepted and implemented.

For more info on stryker, please visit stryker-mutator.io.

Getting Started

This plugin requires Grunt ~0.4.5 and @d-es-ign/stryker-js-core ^1.0.0.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin using the following commands:

npm install stryker stryker-api grunt-stryker --save-dev

Once stryker and the plugin have been installed, the plugin may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-stryker');

The "stryker" task

Overview

In your project's Gruntfile, add a section named stryker to the data object passed into grunt.initConfig() and then add a task. In this example we've called the task jasmine due to the fact that we plan on using the task for running Jasmine tests, but feel free to use any name you want.

grunt.initConfig({
  stryker: {
    jasmine: {
      files: {
        libs: [/* List your library files here */],
        src: [/* List your source files here */],
        tests: [/* List your test files here */]
      },
      mutate: {
        src: [/* List the files that you want to mutate here */]
      }
    },
  },
});

Options

files

Type: Object

An object with arrays of globbing expressions used for selecting all files needed to run the tests. These include: test files, library files, source files (the files selected with mutate) and any other file you need to run your tests. The order of the files specified here will be the order used to load the file in the test runner (karma).

mutate

Type: Object

An object with arrays of globbing expressions used for selecting the files that should be mutated.

options.configFile

Type: string

A location to a Stryker config file. That file should export a function which accepts a "config" object. On that object you can configure all options as an alternative for the Gruntfile. If an option is configured in both the Gruntfile and in the config file, the Gruntfile wins. An example config:

module.exports = function(config){
  config.set({
    files: ['src/**/*.js', 'test/myFirstFile.spec.js', 'test/mySecondFile.spec.js'],
    mutate: ['src/**/*.js'],
    logLevel: 'debug'
  });
}

Other options

All options will be passed through to Stryker itself. See the readme there for more info.

Usage Examples

Default Options

In this example, we run mutation testing using every JavaScript file in the src folder and every file in the test folder except for test/IgnoredTestFile.js. We've called the task jasmine here due to the fact that we plan on using the task for running Jasmine tests, but feel free to use any name you want. Feel free to also choose the names of the arrays of files, we've used src and tests in this example.

grunt.initConfig({
  stryker: {
    jasmine: {
      files: {
        src: ['src/**/*.js'],
        tests: ['test/**/*.js', '!test/IgnoredTestFile.js']
      },
      mutate: {
        src: ['src/**/*.js']
      }
    },
    options: {
        testFramework: 'jasmine',
        testRunner: 'karma'
    }
  },
});

Config file

In this example, we run grunt-stryker using a config file. We could overwrite the config file by manually configuring our grunt task as well.

// Gruntfile.js
grunt.initConfig({
  stryker: {
    jasmine: {
      options: {
        configFile: 'stryker.conf.js'
      }
    },
  },
});

The content of the file stryker.conf.js in this example is:

// stryker.conf.js
module.exports = {
  files: [{ pattern: 'src/**/*.js', mutated: true} , 'test/myFirstFile.spec.js', 'test/mySecondFile.spec.js'],
  testFramework: 'jasmine',
  testRunner: 'karma'
};

Note: It's not possible to exclude files in a config file using ! like: !myFile.js. This is possible when you don't use a config file but define the options your Gruntfile. See node-glob to know what is possible.

Supported mutations

For the list of supported mutations, please take a look at the mutations supported by stryker

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.