How to skip one test in test file with Jest?

Sometimes, we want to skip one test in test file with Jest.

In this article, we’ll look at how to skip one test in test file with Jest.

How to skip one test in test file with Jest?

To skip one test in test file with Jest, we can call test.skip in our test code.

For instance, we write:

test('it is delicious', () => {
  expect(isDelicious()).toBeTruthy();
});

test.skip('it is not yellow', () => {
  expect(isYellow()).toBeFalsy();
});

to call test to create and run the first test.

And we call test.skip to skip the 2nd test.

Conclusion

To skip one test in test file with Jest, we can call test.skip in our test code.