Quickly flip javascript tests between: only <--> disabled <--> default <--> only.
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
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.
- xargs
- sed (OSX inbuilt version tested only)
- ripgrep
Works with mocha, jasmine, jest and any other test runner that uses describe
and it
.
- Get flip-tests
Go to releases --> download source or
git clone https://github.com/lukeaus/flip-tests.git
-
add flip-tests to your path
-
start flippin'
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
Tested on macOS only.
Please use the GitHub issue tracker for any bugs or feature suggestions:
https://github.com/lukeaus/flip-tests/issues
Please submit patches to code or documentation as GitHub pull requests.
Contributions must be licensed under the MIT License. The contributor retains the copyright.