question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 https://github.com/nrwl/nx/issues/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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Rainnutcommented, 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
};
0reactions
OlhaFilatovacommented, Oct 12, 2022

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);
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Express.js: TypeError: path argument is required to res.sendFile
Here is the error while clicking on the download button. TypeError: path argument is required to res.sendFile. javascript · node.js ...
Read more >
cypress-io/cypress - Gitter
New to cypress with Nx. I'm getting this if I run a test. path argument is required to res.sendFile.
Read more >
Express.js res.sendFile() Function - GeeksforGeeks
The res.sendFile() function basically transfers the file at the given path and it sets the Content-Type response HTTP header field based on ...
Read more >
File uploads using Node.js - CodeForGeek
You need to add that folder as a static path where your file is getting uploaded and once the client is trying to...
Read more >
API Reference - Express 4.x
A new body object containing the parsed data is populated on the request object after the middleware (i.e. req.body ), or an empty...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found