I hope you’ve installed –
npm install --save-dev @types/jasmine
Then put following import at the top of the hero.spec.ts
file –
import 'jasmine';
It should solve the problem.
More Related Contents:
- How to write unit testing for Angular / TypeScript for private methods with Jasmine
- How can I unit test a component that uses the Router in Angular?
- Updating input html field from within an Angular 2 test
- Unit testing an observable in Angular 2
- Unit testing click event in Angular
- Any way to test EventEmitter in Angular2?
- How to unit test a component that depends on parameters from ActivatedRoute?
- Mocking AngularJS module dependencies in Jasmine unit tests
- How to mock Angular 4.3 httpClient an error response in testing
- How do I trigger a keyup/keydown event in an angularjs unit test?
- What is the difference between fakeAsync and async in Angular testing?
- Angular 6 – how to mock router.events url response in unit test
- typescript anonymous object with variable based label value
- What’s the difference between faking, mocking, and stubbing?
- How do I create a singleton service in Angular 2?
- How to import JSON File into a TypeScript file?
- How do I unit-test saving file to the disk?
- How to terminate a program when it crashes? (which should just fail a unit test instead of getting stuck forever)
- localStorage is not defined (Angular Universal)
- Prevent IE11 caching GET call in Angular 2
- When to use Interface and Model in TypeScript / Angular
- Whats the difference between using a class and interface?
- How to pass data to dialog of angular material 2
- RSpec vs Cucumber (RSpec stories) [closed]
- Angular 4/5 HttpClient: Argument of type string is not assignable to ‘body’
- RxJs get value from observable
- What is pipe for in RxJS?
- How to create an Observable from static data similar to http one in Angular?
- Why is it hard to unit test a system that depends on singletons?
- How to generate components in a specific folder with Angular CLI?