shmest v0.0.3
Shmest
Shmests tests...
Basic usage
In the project you want to leverage shmest in, first npm install shmest
<-- NOT YET PUBLISHED, INSTALL VIA GITHUB FOR NOW.
Then, add the following to your jest config:
"jest": {
...
"setupFiles": ["shmest"]
...
},
Note: If you use shmest only in your tests, you don't need to have jest in your dependencies anymore. Shmest includes Jest in your tests!
To run your tests, setup a npm script like
...
"test": "shmest"
...
and then you can do npm run test path/to/test/file.js
as you normally would. ALL Jest command line flags should pass through to the underlying framework.
shmest.describe
TODO
shmest.test
shmest.test
can use the syntax you familiar with such as:
shmest.test("this is my sweet test", () => {
// test stuff
expect(things).toBe(correct); // note you can use normal expectations just fine!
});
shmest.test.skip
and shmest.test.only
work as well.
Optionally, you can use an object of some options for the first argument instead to get some more fine grain controls around things.
shmest.test.skip(
{
name: "this is my sweet test",
important: true,
caseId: "TC#1234",
skipMessage: "blocked by BUG-123"
},
() => {
// test stuff
expect(things).toBe(correct);
}
);
Dry Run
If you want to get the output of your tests without actually running your tests, simply set the environment variable SHMEST_DRY_RUN
to true
before you run your tests. Any targeted tests will "run", but their actual test code will be ommitted. This can be useful for generating reports of what tests exist.
Test Case Reporter
TODO