https://cypress.io logo
Hello everyone! Was hoping to get a bit of help wi...
# e2e-testing
s
Hello everyone! Was hoping to get a bit of help with a small issue I am having 🙂 In my old situation, I used webpack-dev-server to serve my app, and then cypress would do it's thing and generate coverage reports. In the new situation, I use node express to serve the production build locally, everything works fine except Cypress doesn't seem to generate these coverage files. The error I am getting is this:
Copy code
zsh
Cannot find coverage file /Users/'...'/Documents/github/checkout/.nyc_output/out.json
Skipping coverage report
Again, it works just fine with webpack-dev-server. The folder structure is (when using webpack-dev-server) as follows:
Copy code
cypress-coverage/ <- it's a folder above dist/
dist/
  express.js
  all my bundled files
The express server looks like this:
Copy code
js
const express = require('express');
const path = require('path');

const app = express();
app.set('view engine', 'ejs');

const port = process.env.PORT || 8080;

const basename = '/page/checkout';

app.use(express.json());
app.use(express.urlencoded({ extended: true }));

app.disable('x-powered-by');
app.use(basename, express.static(__dirname));

app.get('*', (req, res) => {
    res.status(200).render(path.join(__dirname, 'index.ejs'));
});

app.post('*', (req, res) => {
    res.status(200).render(path.join(__dirname, 'index.ejs'));
});

app.listen(port, () => {
    // eslint-disable-next-line no-console
    console.info(`Listening on port ${port}...`);
});
Any ideas what could be the issue?