Intern在AMD环境中运行其测试,因此
requireAMD加载程序(
require而不是Node 加载器)也要在其中运行,因此是您的错误。
要加载Node模块,请使用
intern/dojo/node!AMD插件并将其包含在模块的依赖项中,例如:
define([ ..., 'intern/dojo/node!http'], function (..., http) { // Now http contains the exports of Node's http module});这在《 Intern用户指南》的“ 测试CommonJS模块 ”下进行了记录。



