Git Product home page Git Product logo

danger-plugin-jest's Introduction

danger-plugin-jest

Build Status npm version semantic-release

Danger plugin for Jest

Usage

Setup Jest

This Danger plugin relies on modifying your Jest configuration slightly on CI to also output a JSON file of the results.

You need to make the yarn jest command include: --outputFile test-results.json --json. This will run your tests like normal, but will also create a file with the full test results after.

You may also want to add the JSON output file to your .gitignore, since it doesn't need to be checked into source control.

Setup Danger

Install this Danger plugin:

yarn add danger-plugin-jest --dev

By default, this package will assume you've set the filename as test-results.json, but you can use any path.

// dangerfile.js
import path from "path";
import jest from "danger-plugin-jest";

// Default
jest();
// Custom path
jest({ testResultsJsonPath: path.resolve(__dirname, "tests/results.json") });

See src/index.ts for more details.

Changelog

See the GitHub release history.

Development

Install Yarn, and install the dependencies - yarn install.

Run the Jest test suite with yarn test.

This project uses semantic-release for automated NPM package publishing.

The main caveat: instead of running git commit, run yarn commit and follow the prompts to input a conventional changelog message via commitizen.

❤️

danger-plugin-jest's People

Contributors

greenkeeper[bot] avatar macklinu avatar orta avatar

Watchers

 avatar  avatar

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.