Git Product home page Git Product logo

jest-runner-standard's Introduction

jest-runner-standard

JavaScript Style Guide

Standard Style runner for Jest.

Motivation

I liked the idea of the jest-runner-eslint, and thought it would be great to have one like that for standard. I also wanted to add a nice error messaging that will give you some context about where in the code you made a mistake.

Show case

Demonstration

Not only we run them on file changes, alongside with related jest tests, but also we have this beautiful jest-like visualisation of the failure :-)

Usage

Make sure you have standard already installed.

npm install --save-dev jest-runner-standard

In your jest.config.js, assuming you want to run both your tests and linting:

module.exports = {
  projects: [
    {
      'runner': 'jest-runner-standard',
      'testMatch': ['<rootDir>/**/*.js'],
      'displayName': 'standard linting'
    },
    {
      'displayName': 'test'
    }
  ]
}

run

jest --watch

Profit!

Configuration

(Changed in 0.0.12) By default we don't fix standard errors. I would recommend using a IDE shortcut for that, or running a separate console command for that (standard --fix). Unfortunately having them done automatically on file-save tend to be a bit confusing to IDEs/Editors, for changing files you have your cursor in :-( But, if you want to try and see if the workflow suits you, run jest with STANDARD_AUTOFIX=true

Examples

This repo (if you want to use jest while modyfing the package, do npm link and then npm link jest-runner-standard)

also:

https://github.com/TheBrainFamily/TheBrain2.0

TODO

CREDITS

Using internally a fork of https://github.com/rogeliog/create-jest-runner , and was obviously inspired by https://github.com/jest-community/jest-runner-eslint . Huge kudos to the author @rogeliog and contributors :)

jest-runner-standard's People

Contributors

lgandecki 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.