-
Notifications
You must be signed in to change notification settings - Fork 108
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
Cannot find coverage file .nyc_output/out.json in the automated build. #528
Comments
Any update or information on this? |
is there any update? I came across same issue |
Same issue here. Locally it's working fine but on the gitlab-ci pipeline some tests are not passing:
Any idea? |
@arberosmani you can have a look at my repo relatively recent update. The github cli doesn't fail. Note: the repo is typescript! |
no update on this issue? |
I'm facing the same issue, any update on this one please? |
Hello @Baluditor @Muthu2190 You might have a different setup and need to see how code is instrumented using yoursetup |
Hi @MKhasib, thank for the tip. import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
import istanbul from 'vite-plugin-istanbul';
import svgr from 'vite-plugin-svgr';
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
const shouldInstrument =
process.env.VITE_APP_ENV === 'local' ||
process.env.VITE_APP_ENV === 'testing' ||
process.env.VITE_APP_ENV === 'qa';
return defineConfig({
base: '/',
build: {
sourcemap: true,
rollupOptions: {
// Silence warnings https://github.com/vitejs/vite/issues/15012
onLog(level, log, handler) {
if (
log.cause &&
log.cause['message'] === `Can't resolve original location of error.`
) {
return;
}
handler(level, log);
},
output: {
// Disable source maps for dependencies
sourcemap: false,
},
},
},
plugins: [
react(),
svgr(),
istanbul({
extension: ['.js', '.jsx', '.ts', '.tsx'],
exclude: ['node_modules', 'cypress', '**/*.cy.ts', '**/*.cy.tsx'],
cypress: true,
// By default it will always instrument the code.
// We only want to instrument the code when we are running it locally or in the testing or QA environment.
requireEnv: !shouldInstrument,
forceBuildInstrument: shouldInstrument,
}),
],
server: {
open: true,
port: 3000,
},
});
}; It's not the pretties solution but it gets the job done. Will try to downgrade the package as well to see if it solves it, will report back (but it might take a while). |
I have followed this example for my project https://github.com/bahmutov/next-and-cypress-example and i can get the output in the .nyc_output folder while running in local env, but not in the automated build.
package.json:
.babelrc:
.nycrc.json:
cypress/support/index.js:
cypress/plugins/index.ts:
Error message from automated build:
The text was updated successfully, but these errors were encountered: