Sometimes, we want to skip one test in test file Jest and JavaScript.
In this article, we’ll look at how to skip one test in test file Jest and JavaScript.
How to skip one test in test file Jest and JavaScript?
To skip one test in test file Jest and JavaScript, we can use the skip method.
For instance, we write
test("it is raining", () => {
expect(inchesOfRain()).toBeGreaterThan(0);
});
test.skip("it is not snowing", () => {
expect(inchesOfSnow()).toBe(0);
});
to call test.skip to skip the 2nd test.
The first test will be run.
Conclusion
To skip one test in test file Jest and JavaScript, we can use the skip method.