gpt4 book ai didi

ember.js - 早午餐,JSdom : Object [ jsdom NodeList ]: contains 3 items has no method 'map'

转载 作者:行者123 更新时间:2023-12-02 06:05:51 29 4
gpt4 key购买 nike

我正在尝试使用 Ember、Brunch 和 JSDom 进行 headless 测试。我正在使用 ember-brunch-skeleton 生成应用程序。

https://github.com/fuseelements/ember-brunch-skeleton

我已经安装了所有依赖项。

当我尝试运行“早午餐测试”时,出现以下错误。似乎我在这里错过了一些基本的东西,但这是我第一次使用 node.js/jsdom/mocha 等。我错过了什么?

  TypeError: Object [ jsdom NodeList ]: contains 3 items has no method 'map'
at getScriptFilesPath (/usr/local/lib/node_modules/brunch/lib/commands/test.js:62:60)
at readTestFiles (/usr/local/lib/node_modules/brunch/lib/commands/test.js:80:25)
at fs.readFile (fs.js:176:14)
at fs.close (/usr/local/lib/node_modules/brunch/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:90:5)
at Object.oncomplete (fs.js:297:15)

最佳答案

看起来这与 jsdom 的 0.4.0 版本中断了。具体来自 changelog :

  • Change: NodeLists no longer inconsistently have array methods. Previously, live node lists would have indexOf, while static node lists would have them all. Now, they have no array methods at all, as is correct per the specification.


如果您正在寻找快速修复,恢复到 jsdom 0.3.4 应该可以解决问题:
npm uninstall jsdom
npm install jsdom@0.3.4
brunch test

关于ember.js - 早午餐,JSdom : Object [ jsdom NodeList ]: contains 3 items has no method 'map' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14758477/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com