TypeError: Cannot read property 'add' of undefined
at <Jasmine>
at http://localhost:9876/_karma_webpack_/webpack:/node_modules/ts-mockito/lib/MethodStubSetter.js:20:1
at <Jasmine>
at MethodStubSetter.push../node_modules/ts-mockito/lib/MethodStubSetter.js.MethodStubSetter.thenReturn (http://localhost:9876/_karma_webpack_/webpack:/node_modules/ts-mockito/lib/MethodStubSetter.js:19:1)
at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/webpack:/src/app/components/edit-release/edit-release.component.spec.ts:199:37)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:388:1)
at ProxyZoneSpec.push../node_modules/zone.js/dist/zone-testing.js.ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-testing.js:288:1)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:387:1)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone.js:138:1)
at runInTestZone (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-testing.js:509:1)
at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/webpack:/node_modules/zone.js/dist/zone-testing.js:524:1)
In Unit Test:
when(component.validDate()).thenReturn(true);
In Component:
validDate() {
return new Date(this.release.date) >= new Date();
}
In Unit Test:
when(component.validDate()).thenReturn(true);
In Component: