Intern 4 测试加载 Dojo2 加载器失败
Intern 4 tests fail to load the Dojo2 loader
我正在从实习生 3/requirejs 迁移到实习生 4/dojo2。我正在尝试 运行 测试,但在功能检查之后它会在加载我的测试之前立即失败并出现此错误:
Listening on localhost:9000 (ws 9001)
Tunnel started
‣ Created remote session chrome 66.0.3359.139 on XP (bc531663-f9f7-4cba-9038-6ab15808e9a0)
Suite chrome 66.0.3359.139 on XP FAILED
Error: Unable to load /..\node_modules\intern/loaders/dojo2.js
at HTMLScriptElement.<anonymous> <node_modules\intern\browser\remote.js:667:23264>
TOTAL: tested 1 platforms, 0 passed, 0 failed; suite error occurred
它在 http://localhost:9000/__intern/browser/remote.html
的那个文件上进行 404ing,因为它试图从错误的路径中获取 dojo2.js 从它的外观来看。如果我将配置脚本中的 dojo2
替换为 __intern/loaders/dojo2.js
,它将在 /node_modules/@dojo/loader/loader.js
上显示 404。看起来它只是在寻找错误的路径,我可以做些什么来解决这个问题吗?
intern.json
{
"loader": {
"script": "dojo2",
"config": {
"waitSeconds": 60,
"packages": [ {
"name": "objects",
"location": "objects"
}, {
"name": "edits",
"location": "./",
"main": "edits"
}, {
"name": "prepare",
"location": "TESTS",
"main": "prepare"
}, {
"name": "common",
"location": "./",
"main": "common"
}, {
"name": "socket",
"location": "http://localhost:2020/socket.io",
"main": "socket.io"
}
]
}
},
"suites": [
"./functional/InitTests.js"
],
"environments": [ {
"browserName": "chrome"
}
],
"tunnelOptions": {
"drivers": [
"chrome"
],
"port": 4444,
"version": "3.4.0",
"maxConcurrency": 1,
"runnerClientReporter": {
"writeHtml": false
}
},
"tunnel": "null",
"leaveRemoteOpen": true,
"grep": ""
}
有几个潜在的问题:
- 你安装了
@dojo/loader
了吗?加载器脚本要求将关联的加载器安装为实习生的对等体。
- 使用 AMD 加载程序时,将测试指定为模块 ID 而不是文件名
./functional/InitTests.js
是否真的包含功能测试?如果是,则应在 functionalSuites
. 下指定
我正在从实习生 3/requirejs 迁移到实习生 4/dojo2。我正在尝试 运行 测试,但在功能检查之后它会在加载我的测试之前立即失败并出现此错误:
Listening on localhost:9000 (ws 9001)
Tunnel started
‣ Created remote session chrome 66.0.3359.139 on XP (bc531663-f9f7-4cba-9038-6ab15808e9a0)
Suite chrome 66.0.3359.139 on XP FAILED
Error: Unable to load /..\node_modules\intern/loaders/dojo2.js
at HTMLScriptElement.<anonymous> <node_modules\intern\browser\remote.js:667:23264>
TOTAL: tested 1 platforms, 0 passed, 0 failed; suite error occurred
它在 http://localhost:9000/__intern/browser/remote.html
的那个文件上进行 404ing,因为它试图从错误的路径中获取 dojo2.js 从它的外观来看。如果我将配置脚本中的 dojo2
替换为 __intern/loaders/dojo2.js
,它将在 /node_modules/@dojo/loader/loader.js
上显示 404。看起来它只是在寻找错误的路径,我可以做些什么来解决这个问题吗?
intern.json
{
"loader": {
"script": "dojo2",
"config": {
"waitSeconds": 60,
"packages": [ {
"name": "objects",
"location": "objects"
}, {
"name": "edits",
"location": "./",
"main": "edits"
}, {
"name": "prepare",
"location": "TESTS",
"main": "prepare"
}, {
"name": "common",
"location": "./",
"main": "common"
}, {
"name": "socket",
"location": "http://localhost:2020/socket.io",
"main": "socket.io"
}
]
}
},
"suites": [
"./functional/InitTests.js"
],
"environments": [ {
"browserName": "chrome"
}
],
"tunnelOptions": {
"drivers": [
"chrome"
],
"port": 4444,
"version": "3.4.0",
"maxConcurrency": 1,
"runnerClientReporter": {
"writeHtml": false
}
},
"tunnel": "null",
"leaveRemoteOpen": true,
"grep": ""
}
有几个潜在的问题:
- 你安装了
@dojo/loader
了吗?加载器脚本要求将关联的加载器安装为实习生的对等体。 - 使用 AMD 加载程序时,将测试指定为模块 ID 而不是文件名
./functional/InitTests.js
是否真的包含功能测试?如果是,则应在functionalSuites
. 下指定