fit('only this test will run', () => {
expect(true).toBe(false);
});
it('this test will not run', () => {
expect(true).toBe(false);
});
xit('this test will be ignored', () => {
expect(true).toBe(false);
});
如果您使用的是Visual Studio Code,您可以利用它并通过按下F5按钮来运行当前选择的测试(在代码编辑器中)。为此,我们需要在".vscode/launch.json"文件中创建一个新的启动配置块。在该配置中,我们将使用预定义变量,它在运行时被适当的(不幸的是并不总是)值替换。在所有可用的测试中,我们只对这些感兴趣: