← All interview questions

Skill Zuno · skillzunos.com · Fullstack Pro

Jasmine Karma interview questions

Prepare for Jasmine Karma interviews on Skill Zuno. This practice book covers Jasmine Karma interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.

Open Jasmine Karma on Skill Zuno

Also see the Jasmine Karma tutorial.

Jasmine and Karma are the testing tools long used by default in Angular projects. Jasmine is a behaviour-driven testing framework with describe and it blocks, matchers and spies, while Karma runs those tests in real browsers. Interviews cover writing Jasmine specs, spies, asynchronous tests, testing Angular components and services with TestBed, configuring Karma and code coverage.

Sample Jasmine Karma interview questions

What is the difference between Jasmine and Karma?

Jasmine is the test framework that defines and asserts tests. Karma is the test runner that launches browsers, loads the code and tests, and reports the results.

What is the difference between toBe and toEqual?

toBe checks identity with ===. toEqual checks deep equality, so two different objects with the same properties pass toEqual but fail toBe.

How do you mock a service dependency in an Angular test?

Create a spy object with jasmine.createSpyObj('UserService', ['getUser']), set return values with and.returnValue, and provide it in TestBed with useValue.

What do fakeAsync and tick do?

fakeAsync runs the test in a zone with a simulated clock. tick(ms) advances that clock, so timers and promises resolve instantly without real waiting.

Why call fixture.detectChanges()?

In tests, Angular does not run change detection automatically. detectChanges triggers it so bindings update, and the first call also runs ngOnInit.

What you can practice

  • Jasmine Karma interview questions for beginners and experienced developers
  • Level-based practice: New, Easy, Medium, Hard, and Diff
  • Fullstack Pro topics alongside Jasmine Karma on skillzunos.com

More Fullstack Pro interview questions

All interview questions