- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 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.
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/
如何从一个 NodeList 中删除另一个 NodeList?例如,如果我有: var all = document.querySelectorAll('*'); var divs = documen
我是 javascript 编程的新手,我想了解更多。当我单击同一 nodeList 中的任何节点时,我想从 nodeList 的每个节点中删除类名。 我写了这段代码: d = document.qu
我正在使用 jQuery 编写一个网站,并且尝试将表单发布到另一个 PHP 文件而不离开页面。然后我找到了一种使用 jQuery 发布表单的方法。但是,当我将数据发布到 PHPpage 时,出现此错误
在下面的代码摘录中,products是一个xml节点列表,其结构为: 1 item1 2 item2 xml = httpRequest.r
我通常听说是因为实时节点列表“不好”(see this Zakas article)并通知 querySelectorAll 返回静态 HTMLCollection 的决定。为什么人们认为实时 Nod
我正在使用 Vaadin,一个 Java 框架。 我处理 XML 内容,我想用这些信息制作一棵树,但我不知道 XML 内容会持续多久。我发送一个调用来获取 XML,但使用不同的 IP 地址。 我知道如
我有一份正在搜索特定实例的文档,但是这些实例是由用户指定的,并且有多个。除了 for 循环内的 for 循环根据数组搜索 Nodelist 之外,我是否缺少一种不会使系统陷入困境的方法?或者更简单的方
这个问题在这里已经有了答案: Why doesn't nodelist have forEach? (10 个回答) Looping through a nodelist JS (1 个回答) 3年前
我想从其中一个包含特定文本的父节点获取所有子节点。换句话说:我开始搜索某个子节点,我确信该子节点包含我需要的一些字符串。一旦找到它,我需要获取同一级别的其他节点,而不是从与相同 Xpath 表达式匹配
我有一个事件日历。我遇到的问题是每次将事件插入到特定日期时,我的其他事件 innerHTML 也会发生变化。 我已经尝试过 event.stopPropagation() 以及 event.stopI
nodeList 和arguments 只是“类似数组”的优点是什么? 最佳答案 参数 arguments 不是真正的数组是历史产物。尽管正如在另一个答案中指出的那样,它具有 callee 属性,并且
我正在寻找一种面向 future 的方法来遍历 NodeList(即来自 element.querySelectorAll(selector))以及跨浏览器兼容。以前我一直在使用 ES6 Spread
我正在写一篇关于 Java 性能的演示文稿,我正在尝试确定这是否是一种不好的做法。我是一个 c++ 的人,所以我还不知道关于 java 的一切。我没有 item() 的源代码,我需要一个快速的答案!
首先是:这不是问如何将 NodeList 变成数组。这是相反的。 为了保持一致性,我想创建一个返回 NodeList 的函数,就像 document.querySelectorAll() 一样。 这是
我的 html 页面上有 3 个 div,所有这些都被分配了一个类名“tagline”。我想通过 JavaScript 为每个 div 分配样式。但我认为 NodeList 对象不允许我这样做。她就是
我有使用 document.getElementsByTagName('p') 存在于页面中的标签. 我想要的是,在 nodeList 中添加这些标签,就像 document.querySelecto
我已经使用nodeList = document.createDocumentFragment().childNodes;创建了一个NodeList;, 然后我设置了 nodeList[0] = do
我有一个包含 3 个对象的数组对象。我想删除除第一个对象之外的所有对象。 这是我从 XML 中获得的数据: mrArr[0] = "Val" = "5"
注意:在假定此问题重复之前,此问题底部有一个部分说明了为什么一些类似的问题没有提供我正在寻找的答案。 我们都知道将 NodeList 转换为 Array 很容易,并且有很多方法可以做到这一点: [].
我在 javascript 中有一个代码并返回 [object NodeList] 我怎么能纠正这个 请帮我 function downloadDiv(filename, elemen
我是一名优秀的程序员,十分优秀!