Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create react app run test apecific folfer

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  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #react #app #run #test #apecific #folfer
ADD COMMENT
Topic
Name
9+6 =