"TypeError: deps.map is not a function" importing URI.js from intern.js unit tests
"TypeError: deps.map is not a function" importing URI.js from intern.js unit tests
我在尝试使用 URI.js from intern.js unit tests. I saw "TypeError: deps.map is not a function" in resolveDepMaps() of node_modules/dojo/dojo.js 时遇到构建错误,但 none 的答案似乎适用于我的情况。
- 我在这里发布了一个测试用例:https://github.com/cowwoc/intern-import-urijs
- 我在这里发布了错误报告:https://github.com/theintern/intern/issues/708
有什么想法吗?
引用 jason0x43:
One of the dependencies in the attached project, punycode, uses an AMD define call of the form define(id, factory). This is a case that isn't currently handled by Intern's internal loader.
The easiest fix would be to use an alternative AMD loader for tests, such as the normal Dojo loader or RequireJS. For example, to use requirejs, install requirejs as a project dependency and add the following property to the test config:
loaders: {
'host-node': '../../node_modules/requirejs'
},
这个变通办法解决了我的问题。
我在尝试使用 URI.js from intern.js unit tests. I saw "TypeError: deps.map is not a function" in resolveDepMaps() of node_modules/dojo/dojo.js 时遇到构建错误,但 none 的答案似乎适用于我的情况。
- 我在这里发布了一个测试用例:https://github.com/cowwoc/intern-import-urijs
- 我在这里发布了错误报告:https://github.com/theintern/intern/issues/708
有什么想法吗?
引用 jason0x43:
One of the dependencies in the attached project, punycode, uses an AMD define call of the form define(id, factory). This is a case that isn't currently handled by Intern's internal loader.
The easiest fix would be to use an alternative AMD loader for tests, such as the normal Dojo loader or RequireJS. For example, to use requirejs, install requirejs as a project dependency and add the following property to the test config:
loaders: { 'host-node': '../../node_modules/requirejs' },
这个变通办法解决了我的问题。