Disabled and Focused Tests

You can disable tests without commenting them out by just pre-pending x to the describe or it functions, like so:TypeScript

Copyxdescribe('Hello world', () => { (1)
  xit('says hello', () => { (1)
    expect(helloWorld())
        .toEqual('Hello world!');
  });
});

These tests will not be run.

Conversely, you can also focus on specific tests by pre-pending with f, like so: TypeScript

Copyfdescribe('Hello world', () => { (1)
  fit('says hello', () => { (1)
    expect(helloWorld())
        .toEqual('Hello world!');
  });
});

Out of all the tests in all the tests suites and test specs, these are the only ones that will be run.

Last updated