📅  最后修改于: 2022-03-11 15:01:06.084000             🧑  作者: Mango
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