Skip to content
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

path argument is required to res.sendFile leads to "No tests found" error #18607

Closed
dante-wisestep opened this issue Oct 22, 2021 · 9 comments
Closed
Labels
stale no activity on this issue for a long period

Comments

@dante-wisestep
Copy link

dante-wisestep commented Oct 22, 2021

Current behavior

After running npx cypress open (and starting tests) Cypress runner encounters error below
Screenshot 2021-10-22 at 16 01 33

Terminal shows information:
Screenshot 2021-10-22 at 16 05 49

Desired behavior

Cypress runner "sees" tests and lets me run them.

Test code to reproduce

In pursuit of solution I followed suggestions from issue nrwl/nx#1707, but workarounds stored there didn't do the trick. Some code:

  • cypress.json
    Screenshot 2021-10-22 at 16 02 40
  • package.json

Screenshot 2021-10-26 at 11 10 22

Cypress Version

8.6.0

Other

No response

@ScriptyChris
Copy link

ScriptyChris commented Feb 9, 2022

Hey @dante-wisestep, have you found a fix? I am struggling with the same issue (using Cypress version 9.1.1), which also involves TypeScript. I have *.spec.ts and *.spec.js files, but even despite passing only one test to run by --spec "cypress/integration/fileName.spec.js" i receive the same error.

What i managed to debug in Cypress'es packages/server/lib/controllers/spec.js file is that the spec variable points to the spec file, but resolved filePath is already undefined. Though .catch(..) handler doesn't seem to be called.

@dante-wisestep
Copy link
Author

Unfortunetely I'm stuck as well. But thanks for your input! Eventually someone will figure it out I hope.

@ScriptyChris
Copy link

ScriptyChris commented Feb 10, 2022

Do you maybe use some plugin with file:preprocessor API? I am trying to use module-alias module to resolve custom module path aliases and when i don't return a thing from on method (which should return a promise) i receive this res.statusFile error as you, but if i comment out .on('file:preprocessor', (file) => { /* .. */ }) event handler then error is gone.

I am now trying to use file:preprocessor plugin method properly to resolve my module aliases.

@BlueWinds
Copy link
Contributor

If someone could work on an isolated reproducible example, it would be easier for us to help - it's unclear what's causing the problem, and without being able to trigger it ourselves, it's hard to track down the issue or help you resolved it. If you can manage to reproduce the problem with a fork of https://github.com/cypress-io/cypress-test-tiny, or in any other publicly accessible repo, I'd be happy to take a look.

As another note, Cypress 10.0 will contain some significant reworking of how test files are located and listed - when it's released, it may very well fix this issue. If we can track down the current problem in 9.x though, we can fix it and add tests to make sure it doesn't come back at a later date, so "it might be fixed in 10.0" doesn't mean we're ignoring 9.x - just a thought I had while reading through this.

@Rainnut
Copy link

Rainnut commented Mar 25, 2022

me too,use [file:preprocessor](https://docs.cypress.io/api/plugins/preprocessors-api#Usage)
ts to js

reply

i resolve bug:at plugin/index.js

const registerTasks = require('./plugins')
module.exports = (on, config) =>{
  registerTasks(on, config)
+  return config
};

@steinybot
Copy link

I just upgraded from 9 to 10 and started hitting this. I'm guessing there is something screwy with my config (it is pretty complicated...).

@OlhaFilatova
Copy link

Make sure that callback function for file:preprocessor returns correct result:
https://docs.cypress.io/api/plugins/preprocessors-api#The-callback-function-should-return-one-of-the-following
a promise that resolves with a path to the compiled file or rejects with error
For me this was the reason for such error message.
I passed a callback that was calling preprocessor generation inside and returning wrong result.

Example with error:

on("file:preprocessor", () => {
  console.log("FILE PREPROCESSOR");
  webpackPreprocessor(options);
};

Correct example:

on(
  'file:preprocessor',
  webpackPreprocessor(options)
);

Example with console.log:

on("file:preprocessor", async (file) => {
  console.log("FILE PREPROCESSOR");
  return await webpackPreprocessor(options)(file);
});

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 15, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

7 participants