-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Preprocessor swallows errors and ignores ENOENT for bundled files #1877
Comments
Same problem happens on CI as well: https://circleci.com/gh/cypress-io/cypress-example-recipes/6174 |
Yeah, I guess we don't validate the path returned to make sure there's a file there. So it ends up 404ing in the browser which results in 0 tests. I suppose we should |
Yes, but we are ignoring the error which is the wrong way to go about it. External code should be least trusted in this case.
…Sent from my iPhone
On Jun 5, 2018, at 13:45, Chris Breiding ***@***.***> wrote:
Yeah, I guess we don't validate the path returned to make sure there's a file there. So it ends up 404ing in the browser which results in 0 tests. I suppose we should fs.stat the output path returned and fail if it's not there. But to some degree we need to trust that the preprocessor does the right thing (like erroring when it can't bundle). Because even if the file is there, it could be empty or not javascript or just not the right thing that should have been produced by your source spec file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Figured out what's going on. The problem is in our controller code. res.sendFile takes a node-style callback but we're using it as if it returns a promise, so the error is getting swallowed. If I promisify that |
👍 great detective work. And the test did not catch this?
…Sent from my iPhone
On Jun 5, 2018, at 14:00, Chris Breiding ***@***.***> wrote:
Figured out what's going on. The problem is in our controller code. res.sendFile takes a node-style callback but we're using it as if it returns a promise, so the error is getting swallowed. If I promisify that sendFile it properly errors and fails the test.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We don't have a test concerning |
Just need one e2e test covering this and I am happy |
Released in |
I know this is a closed issue, but I am having this problem with custom commands using below versions:
If I create a brand new project that has no custom commands, I see proper errors in the cli/headless run. If I have defined the support file:
Also the process hangs saying: |
It's nrwl nx issue, if you upgrade to 8.12.10 (latest ver at this time), headless run works as expected. Leaving here if someone else is having this issue |
bug
Cypress 3.0.1 on Mac
I have been playing with a spec preprocessor based on Parcel and noticed a curious thing. If the bundler is configured incorrectly and actually does NOT bundle files but returns a non-existing path, the test runner swallows the error and happily exits with code 0, while showing (and ignoring)
ENOENT
errorExample output
The bundles files are returned like this
Here is the relevant verbose logs
the folder was there, just the file that was supposed to be there does not exist when we return it from preprocessor
The text was updated successfully, but these errors were encountered: