【发布时间】:2020-03-13 16:25:55
【问题描述】:
我在竹子版本中运行我的茉莉花测试时遇到了一个奇怪的问题。测试随机失败并出现以下错误:
Failed: can't convert undefined to object build 18-Nov-2019
03:08:56 ./node_modules/@angular/core/fesm5/core.js/</ReflectionCapabilities.prototype._ownPropMetadata@http://localhost:9876/_karma_webpack_/vendor.js:56242:13
build 18-Nov-2019
03:08:56 ./node_modules/@angular/core/fesm5/core.js/</ReflectionCapabilities.prototype.propMetadata@http://localhost:9876/_karma_webpack_/vendor.js:56265:31
build 18-Nov-2019
03:08:56 ./node_modules/@angular/core/fesm5/core.js/</ReflectionCapabilities.prototype.propMetadata@http://localhost:9876/_karma_webpack_/vendor.js:56260:40
build 18-Nov-2019
03:08:56 ./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js/JitReflector.prototype.propMetadata@http://localhost:9876/_karma_webpack_/vendor.js:117510:16
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/DirectiveResolver.prototype.resolve@http://localhost:9876/_karma_webpack_/vendor.js:32740:40
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/testing.js/MockDirectiveResolver.prototype.resolve@http://localhost:9876/_karma_webpack_/vendor.js:54975:46
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.getNonNormalizedDirectiveMetadata@http://localhost:9876/_karma_webpack_/vendor.js:40491:23
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/CompileMetadataResolver.prototype.loadDirectiveMetadata@http://localhost:9876/_karma_webpack_/vendor.js:40422:18
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._loadModules/</<@http://localhost:9876/_karma_webpack_/vendor.js:53988:31
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._loadModules/<@http://localhost:9876/_karma_webpack_/vendor.js:53987:13
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._loadModules@http://localhost:9876/_karma_webpack_/vendor.js:53984:9
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype._compileModuleAndAllComponents@http://localhost:9876/_karma_webpack_/vendor.js:53969:31
build 18-Nov-2019
03:08:56 ./node_modules/@angular/compiler/fesm5/compiler.js/JitCompiler.prototype.compileModuleAndAllComponentsAsync@http://localhost:9876/_karma_webpack_/vendor.js:53928:32
build 18-Nov-2019
03:08:56 ./node_modules/@angular/platform-browser-dynamic/fesm5/platform-browser-dynamic.js/CompilerImpl.prototype.compileModuleAndAllComponentsAsync@http://localhost:9876/_karma_webpack_
经过几次重新运行测试开始通过。我无法确定根本原因。每次运行都未通过不同的测试。
【问题讨论】:
标签: javascript angular typescript jasmine karma-jasmine