-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing arguments to test script #88
Comments
trying to understand what is going on here... something fishy, or i just don't see the whole picture, yet? this start-server-and-test/src/utils.js Lines 34 to 44 in 890a9be
so when uncommenting the call to lazy ass (lines 35-40) and when passing extra args
to update Jest snapshots, all works nice and smoothly, while scripts being:
can anybody with more knowledge about both |
@12finger right, the
|
@bahmutov sure, that's exactly what i did in the end. i wrote extra extra "helpers".
instead of typing But really, my question was about understanding what goes on there, as clearly the test says
and it still fires the Error! ? I'll might have a look at |
Looks like neither fork fix has merged in yet... anybody still looking at this? I'm looking at a use case of specifying specs when running cypress, for which there doesn't seem to be a good alternative. Particularly not if the spec file arguments are passed in dynamically. |
Got the same issue at the moment. Trying to pass a "spec" dynamically as an argument to run a specific cypress test only and lazyAss is failing. |
Please use the command form shown in https://github.com/bahmutov/start-server-and-test#commands For example to run a single spec {
"scripts": {
"ci": "start-server-and-test 'http-server -c-1 --silent' 8080 'cypress run --spec cypress/integration/location.spec.js'"
}
} Or you can move {
"scripts": {
"start": "http-server -c-1 --silent",
"ci": "start-server-and-test 8080 'cypress run --spec cypress/integration/location.spec.js'"
}
} |
This is closed, yet neither fixed nor marked "won't fix." I'd like to be able to have scripts something like this, while being able to pass random args on the fly to cypress.
|
I would also like this fixed as we are passing in optional test values from the command line to manipulate the test. |
As a workaround to inject parameters to a command, we can use an environment variable |
And maybe to start script to make it simple to refine commands without defining new npm scripts
Currently, let's say we have
npm test
commandand the CI build command could be simply
npm test
Now let's say we want to record tests on Cypress dashboard, this would be simply
cypress run --record
, but how to pass this fromnpm test
? Right now need to define custom commandsand set CI script to use
npm run test:ci
So too much effort to pass
--record
argument. It would be much nicer to pass something like this from CI scriptwhich this package would append to its "test" command and would run
npm run cy -- --record
The text was updated successfully, but these errors were encountered: