I am trying to adapt my npm run test
and npm run test-watch
scripts so that I have 2 - one that runs a subset of tests and one that runs the majority, as I have some slow run tests I don't want running with the main set.
I tried just adding a pattern like this:
"scripts": {
"test": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit *.spec.js",
"test-long": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit *-long.spec.js"
}
But get the error:
Invalid testPattern
*-long.spec.js
supplied. Running all tests instead.
I have now tried applying some RegEx escapes to the string, looking at other examples on various sites, but it still tells me that the pattern is invalid...
"test-long": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" vue-cli-service test:unit (*-long\\.spec\\.js$)"
Invalid testPattern
(*-long\.spec\.js$)
supplied. Running all tests instead.