Git Product home page Git Product logo

angular-stryker-example's Introduction

Angular stryker example

DEPRECATED: The way of working described in this readme is deprecated, although it will still work. Angular-cli is now supported right out of the box in the stryker-karma-runner. Please see our handbook for the official guide for angular projects. It requires angular-cli version 6.1.0, please try to upgrade using the official angular upgrade guide if you're not on that version yet, or you can use this readme if you want.

For angular 5, please see https://github.com/nicojs/angular-stryker-example/tree/72d85e19657247a77faa8e12587d3d301147b2bd

This is an example project on how to use Stryker, the mutation testing framework, in an Angular (CLI) project.

Features

  • Mutates only your typescript code. Not the transpiled JavaScript or 3rd party library code.
  • Uses your Angular CLI webpack build (as much as possible)
  • Uses karma for testing

How to use

Clone this library and run npm install. After that, run npm run stryker.

Enable mutation testing in your angular project

Follow these steps to enable Stryker mutation testing in your project.

  1. Install 2 webpack plugins in your project: npm i -D angular2-template-loader awesome-typescript-loader
  2. Install stryker with plugins: npm i -D stryker-api stryker stryker-webpack-transpiler stryker-html-reporter stryker-typescript stryker-karma-runner
  3. Copy over the stryker.conf.js file and webpack-stryker.conf.js file from this repository.
  4. Add "stryker": "stryker run" to your "scripts" config in your package.json file.
  5. Give it a go: npm run stryker

Notice

We're working on better integration with angular projects, but for now this is it. It might break at the next version, it uses some private api's of Angular. We'll keep working it.

Angular CLI

This project was generated with Angular CLI.

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.