Coder Social home page Coder Social logo

heynest / stryker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stryker-mutator/stryker-js

0.0 1.0 0.0 2.14 MB

The JavaScript mutation testing framework

Home Page: http://stryker-mutator.github.io

JavaScript 6.96% TypeScript 91.97% CSS 0.15% HTML 0.91%

stryker's Introduction

Build Status NPM Node version Gitter BCH compliance

Stryker

Stryker

Professor X: For someone who hates mutants... you certainly keep some strange company.
William Stryker: Oh, they serve their purpose... as long as they can be controlled.

Introduction

For an introduction to mutation testing and Stryker's features, see stryker-mutator.github.io.

Getting started

Stryker is a mutation testing framework for JavaScript. It allows you to test your tests by temporarily inserting bugs.

To install Stryker, execute the command:

$ npm install stryker stryker-api --save-dev

Note: During installation you may run into errors caused by node-gyp. It is safe to ignore them.

To test if Stryker is installed correctly, execute the command:

$ node_modules/.bin/stryker --version

This should print the latest version of Stryker.

Usage

$ node_modules/.bin/stryker <command> [options] [stryker.conf.js]

The only command currently available is run, which kicks off mutation testing.

By default, we expect a stryker.conf.js file in the current working directory. This can be overridden by specifying a different file as the last parameter.

The following is an example stryker.conf.js file:

module.exports = function(config){
  config.set({
    files: ['test/helpers/**/*.js', 
            'test/unit/**/*.js', 
            { pattern: 'src/**/*.js', included: false, mutated: true }
            { pattern: 'src/templates/*.html', included: false, mutated: false }
            '!src/fileToIgnore.js'],
    testFramework: 'mocha',
    testRunner: 'mocha',
    reporter: ['progress', 'clear-text', 'dots', 'html', 'event-recorder'],
    coverageAnalysis: 'perTest',
    plugins: ['stryker-mocha-runner', 'stryker-html-reporter']
  });
}

As you can see, the config file is not a simple JSON file, it should be a common js (a.k.a. npm) module.
You might recognize this way of working from the karma test runner.

Make sure you at least specify the files and the testRunner options when mixing the config file and/or command line options.

Supported mutators

See our website for the list of currently supported mutators.

Configuration

See the stryker's package readme for all config options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.