我收到錯誤Attempt to require unloaded module xxxxxx
以下intern.js測試(myfile.js以下是require('xxxxxx')
)用於測試NodeJS。如何要求使用Intern JS測試NodeJS的模塊?
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文件中設置的屬性有什麼關係?
可能重複[如何從intern.js測試中加載node.js http模塊?](http://stackoverflow.com/questions/26266469/how-do-i-load-the-node -js-HTTP-模塊從 - 內-AN-實習生-JS檢驗) –