I am facing a strange issue while running my jasmine tests in bamboo build. Tests fail randomly with the following error:
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_
After couple of re runs test start passing. I am unable to indenitify the root cause. Evey run fails a different test.