Git Product home page Git Product logo

flip-tests's Introduction

flip-tets

flip-tests

Quickly flip javascript tests between: only <--> disabled <--> default <--> only.

What

Flips tests recursively in current path.

Flip between:

describe.only <--> xdescribe <--> describe <--> describe.only
it.only <--> xit <--> it <--> it.only

Also:

  • Ignores files in .gitignore (if it exists)
  • Will not change if not at start of line (or proceeded by blank space)
  • Will maintain indentation
  • Supports paths with spaces

Why

Say you a working on a feature. You have changed some code under test. You have several tests marked describe.only() and/or it.only. These tests under test might passing (or not). You want to check that your other tests (not marked .only()) still pass. But you don't want to muddy the ouput with the tests that you have marked with .only().

This is where flip-tests comes to the rescue.

Prerequisites

  • xargs
  • sed (OSX inbuilt version tested only)
  • ripgrep

Works with mocha, jasmine, jest and any other test runner that uses describe and it.

Getting Started

  1. Get flip-tests

Go to releases --> download source or

git clone https://github.com/lukeaus/flip-tests.git
  1. add flip-tests to your path

  2. start flippin'

Usage

From: describe.only and it.only

To: xdescribe and xit

flip-tests -ox

From: xdescribe and xit

To: describe.only and it.only

flip-tests -xo

From: describe.only and it.only

To: describe and it

flip-tests -od

From: xdescribe and xit

To: describe and it

flip-tests -xd

From: xdescribe, xit, describe.only and it.only

To: describe and it

flip-tests -ad

Limitations

Tested on macOS only.

Reporting bugs

Please use the GitHub issue tracker for any bugs or feature suggestions:

https://github.com/lukeaus/flip-tests/issues

Contributing

Please submit patches to code or documentation as GitHub pull requests.

Contributions must be licensed under the MIT License. The contributor retains the copyright.

flip-tests's People

Contributors

lukeaus avatar

Stargazers

 avatar

Watchers

 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.