使用-npm test
在ionic 4中使用茉莉花运行单元测试用例时,我遇到此错误。
我还删除了node_modules文件夹,然后再次安装了它,但是问题仍然存在。我还对提供程序部分进行了一些更改,但没有任何效果。 ionic serve
正常运行时没有任何错误。
根据我到目前为止的研发,似乎在角度8 TestBed.get(<ServiceName>)
中的方法无效。
Error: Arguments array must have arguments.
Error: Arguments array must have arguments.
at injectArgs (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:685:1)
at http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:11182:72
at _callFactory (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20295:1)
at _createProviderInstance (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20253:1)
at resolveNgModuleDep (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20228:1)
at _createClass (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20286:1)
at _createProviderInstance (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20250:1)
at initNgModule (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20183:1)
at new NgModuleRef_ (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20892:1)
at createNgModuleRef (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/fesm5/core.js:20881:1)
对此有任何帮助。