cypress run one test file code example
Example 1: cypress run specific test
cypress run --spec 'path/to/files/*.spec.js'
Example 2: cypress run specific test
cypress run --spec path/to/file.spec.js
Example 3: cypress test only one file
cypress run --spec path/to/file.spec.js
// Ex: package.json
{
"scripts": {
"unit-testing": "cypress run --spec path/to/file.spec.js"
}
}
// npm run unit-testing