analog
analog copied to clipboard
No console logs when testing
Please provide the environment you discovered this bug in.
Windows 10
Which area/package is the issue in?
vitest-angular
Description
console.logs aren't appearing on the terminal when running tests
Please provide the exception or error you saw
No response
Other information
Similar issue here
I would be willing to submit a PR to fix this issue
- [ ] Yes
- [X] No
One way is to call vitest --disableConsoleIntercept.
Another, is to tinker the config:
export default defineConfig(({ mode }) => {
return {
plugins: [angular(), nxViteTsPaths()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['src/test-setup.ts'],
include: ['**/*.spec.ts'],
reporters: ['default'],
disableConsoleIntercept: true, // <-- here
},
define: {
'import.meta.vitest': mode !== 'production',
},
};
});
Not sure why it's not present in the docs, but the IDE discovers it perfectly fine, and it also works
I have tried that on a fresh analog app and it's not working.
Could you provide a repro
Could you provide a repro
Can you make a fresh analog app and test on your end? Just to make sure I'm not having an isolated case
Could be related https://github.com/vitest-dev/vitest/pull/5678