【发布时间】:2015-06-14 10:57:23
【问题描述】:
我收到错误 Attempt to require unloaded module xxxxxx 与以下用于测试 NodeJS 的 intern.js 测试(myfile.js 下面执行 require('xxxxxx'))。
define(function(require) {
var bdd = require('intern!bdd');
var myfile = require('../myfile.js');
bdd.describe('the thing being tested', function() {
bdd.it('do the test', function() {
...
目录结构是
intern.js
myfile.js
test
|-- test.js
如何正确地要求文件?没有关于如何使用 BDD 测试接口执行此操作的示例。在How do I load the node.js http module from within an intern.js test? 中也有使用其他样式的示例,但不使用 BDD。
这和我需要在 intern.js 文件中设置的属性有什么关系吗?
【问题讨论】:
标签: javascript node.js unit-testing mocha.js intern