developit / developit/jsdom-worker

Error when running with jest

未关闭
#4 5 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

question
主要语言
JavaScript
星标
291
派生
20
PR 合并指标
30 天内没有已合并 PR

描述

```js
console.error node_modules/jsdom-worker/dist/jsdom-inline-worker.js:1
Error: only absolute urls are supported
at /Users/aaronvasquez/Oyster/webnode/directories/node_modules/node-fetch/index.js:54:10
at new Promise ()
at new Fetch (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/node-fetch/index.js:49:9)
at Fetch (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/node-fetch/index.js:37:10)
at Object..global.fetch (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/jsdom-worker/dist/jsdom-inline-worker.js:1:876)
at new Worker (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/jsdom-worker/dist/jsdom-inline-worker.js:1:1780)
at /Users/aaronvasquez/Oyster/webnode/directories/src/utils/bg-worker/index.js:12:29
at new Promise ()
at performTask (/Users/aaronvasquez/Oyster/webnode/directories/src/utils/bg-worker/index.js:11:5)
at Object. (/Users/aaronvasquez/Oyster/webnode/directories/src/utils/bg-worker/bg-worker.test.js:9:29)
at resolve (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/jest-jasmine2/build/queueRunner.js:38:12)
at new Promise ()
at mapper (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/jest-jasmine2/build/queueRunner.js:31:21)
at Promise.resolve.then.el (/Users/aaronvasquez/Oyster/webnode/directories/node_modules/p-map/index.js:46:16)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
```

This is what I have in my test file:
```js
import "jsdom-worker";
```

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先运行 src/utils/bg-worker/bg-worker.test.js 并阅读 src/utils/bg-worker/index.js,重点关注 stack trace 中显示的 Worker 构造过程。跟踪导入 jsdom-worker 如何导致 node-fetch 接收到非绝对 URL;当 Jest 测试在没有此错误的情况下运行并保留其预期行为时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
testing
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。