How to test without committing?

Viewed 172

The DefinitelyTyped test script refuses to run unless everything is committed:

> npm test
..
Error: 'git diff' should be empty. Following files changed:
..

I find this awkward to use. While writing types I often want to try a few things and run tests to see what works before deciding what to commit. Currently this requires repeatedly committing everything, running tests, then reverting the commit.

Is there a way to run DefinitelyTyped tests without committing?

1 Answers

Commit your changes and then run npm test or yarn test.

If you need to make further changes, use git --amend to update your local commit.

Related