【发布时间】:2013-08-19 15:35:56
【问题描述】:
我正在使用karma 来测试使用 JavaScript 完成的客户端代码。所以我有一个要加载的 html 文件,然后我想在我的测试脚本中从该 html 页面获取所有元素。
下面是karma.conf.js 页面代码,我通过它加载我的所有页面。
// list of files / patterns to load in the browser
files = [
'node_modules/karma-jstd-adapter/jstd-adapter.js',
'testSetup.js',
'config.js',
'jquery.js',
'test.htm',
'startup.test.js'
];
在 test.htm 中有 ID 为 test 的“DIV”。我正在向DIV 动态添加内容。所以我需要验证一下,我想获取元素内容,但我无法做到。
【问题讨论】:
标签: node.js testing karma-runner