Search code examples
javascriptunit-testingjestjsquasar

How to run single file test in quasar testing


I have test code to run in quasar project, but dont want to run all tests. so I tried several below commands, still run all test files.

quasar test --unit jest -t "demo/demo.spec.js"
quasar test --unit jest --spec "demo/demo.spec.js"
quasar test --unit jest -i "demo/demo.spec.js"

what do I have to do?


Solution

  • You can skip Quasar CLI and use the scripts available in package.json.

    npm run test:unit test/jest/__tests__/App.spec.js
    

    A better approach for a quicker test and develop process would be using the test:unit:watch script then filtering for a filename pattern.

    npm run test:unit:watch
    #press p, then type the desired file pattern
    

    Jest Watch Usage