📌  相关文章
📜  创建反应应用程序运行测试 apecific folfer - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:06.084000             🧑  作者: Mango

代码示例1
So, to run a single test in a create-react-app application, I run the following:
npm run test -- -t 'test-name'

Where test-name is the value used in the describe function in jest -
describe('test-name', () => {
  it('does something', () => { ... });
});
  
Also you can use the name of the file in the command, and it will run only it.
npm test src/components/App.test.js