'GitLab Pipeline not able to parse double-dash in npm script property
I am using stencil for building custom web components.
For testing, stencil is using jest CLI for running test files, here is the npm script command Im currently used for running those tests locally:
{
"test:base": "stencil test --spec --e2e",
"test:all": "npm run test:base -- --coverage"
}
It is working perfectly when I am running it locally and the parameter --coverage in script test:all after double-dash can be parsed correctly:
$ npm run test:base -- --coverage --silent
> @heartlandone/[email protected] test:base
> stencil test --spec --e2e "--coverage" "--silent"
[59:13.9] @stencil/core
[59:14.1] v2.14.0 💫
[59:14.2] testing e2e and spec files
[59:16.3] build, vega, dev mode, started ...
[59:16.8] transpile started ...
[59:18.3] transpile finished in 1.45 s
[59:18.3] copy started ...
[59:18.3] generate lazy started ...
[59:18.5] copy finished (17 files) in 210 ms
[59:21.0] generate lazy finished in 2.76 s
[59:21.2] build finished in 4.91 s
[59:21.2] jest args: --coverage --silent --e2e --spec --max-workers=8
...
✨ Done in 36.94s.
However when I run it in gitlab pipeline:
> npm run test:base -- --coverage --silent
> @heartlandone/[email protected] test:base /builds/heartland1/vega/tiger/vega-stencil
> stencil test --spec --e2e "--coverage" "--silent"
[12:42.1] @stencil/core
[12:42.5] v2.14.0 💫
[12:42.9] testing e2e and spec files
[12:51.4] build, vega, dev mode, started ...
[12:51.6] transpile started ...
[12:55.6] transpile finished in 3.99 s
[12:55.6] copy started ...
[12:55.6] generate lazy started ...
[12:56.1] copy finished (17 files) in 516 ms
[13:08.8] generate lazy finished in 13.23 s
[13:08.9] build finished in 17.55 s
[13:09.0] jest args: --coverage --silent -- --e2e --spec
--max-workers=8
No tests found, exiting with code 1
Seems like somehow the double dash is passed into jest directly hence making jest assuming --e2e and --spec is some keyword of the test suite hence filtering out all the existing test suites supposed to be run.
Not sure if this is a known issue or something can be resolved from user side?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
