Issues when running jest with coverage for all packages within a lerna monorepo
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- testing
调研方向
首先比较从 package 目录运行的 Jest coverage 与从 Lerna repository 根目录运行的 coverage,重点关注 node_modules/jsdom-worker/src/index.js:89 以及从另一个 monorepo package 导入的函数。重现 ReferenceError,并确定为什么 cov_* instrumentation 会到达 worker;当 root 级别的 coverage 运行不再出现此故障时即表示完成。
由索引模型根据 Issue 内容生成。
描述
I am not 100% sure if my problem really is jsdom-worker related but I guess here is my best starting point:
I am currently working on a lerna monorepo where one of the packages executes a function in a worker. I therefore included jsdom-worker in the corresponding test for this package. The function is an export from a different file of this package. I had to add /* istanbul ignore file */ to it because otherwise the coverage would fail due to cov_* variables added during testing not being reachable for the worker. Jest is used for testing and coverage.
So far this would be OK - and tests as well as coverage run just fine when run localy from within the package.
But if I do run the coverage from the root directory it always fails with ReferenceError: cov_2j8vgqrgle is not defined in node_modules/jsdom-worker/src/index.js:89:18.
The function that is run in the worker has a function imported from another package of the monorepo and if I do run global coverage (remember: running coverage from within the package is 100% fine) this one seems to be interpreted and cov_* gets added to it which is guaranteed to fail.
Any idea what goes wrong and if there is anything I can do about it?
- 主要语言
- JavaScript
- 星标
- 291
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
developit/jsdom-worker 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
developit/jsdom-worker#26 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 42/100
developit/jsdom-worker#25 · 3 条评论 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
developit/jsdom-worker#24 · 32 条评论 · 59 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 30/100
developit/jsdom-worker#22 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 38/100
developit/jsdom-worker#20 · 2 条评论 ·
查看 developit/jsdom-worker 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
mksglu/context-mode#1200 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
neondatabase/website#5944 ·
-
module: core
难度 2/5 1-3 小时 新手友好度 75/100
bigbluebutton/bigbluebutton#25849 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·