You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added /* istanbul ignore next */ , but it doesn't work.
here is my project: https://github.com/rikisamurai/swc-jest-issue. You can reproduce the issue by running the command pnpm test
version:
importReactfrom'react';import{atom,useAtom}from'jotai';/* istanbul ignore next */exportconstcountAtom=atom(0);exportfunctionCounter(){const[count,setCount]=useAtom(countAtom);return(<h1><p>{count}</p><buttononClick={()=>setCount(c=>c+1)}>one up</button></h1>);}
I've also noticed this issue, it seems to affect export statements that aren't imported elsewhere in our codebase. Also seems to be a similar issue as #119.
Obviously in some cases a solution is to remove the export, but ideally we'd be able to ignore it.
Here's a screenshot of an example from the lcov output:
Even moving the comment to a different spot doesn't resolve it:
The only way I'm able to resolve it is by removing the export:
Or by /* istanbul ignore file */ but that's not ideal.
I'm the author of #119 and I guess export may be the reason it is not ignored. We are using nextjs so components have to be default exported to be picked up
I have added /* istanbul ignore next */ , but it doesn't work.
here is my project: https://github.com/rikisamurai/swc-jest-issue. You can reproduce the issue by running the command
pnpm test
version:
swc/jest doesn't ignore
export const countAtom = atom(0);
source code
jest config:
The text was updated successfully, but these errors were encountered: