Sami C.
1 min readMay 27, 2020

--

In order to create a mock with multiple spies, use jasmine.createSpyObj and pass an array of strings. It returns an object that has a property for each string that is a spy.

tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']);

tape.play();

tape.pause();

tape.rewind(0);

--

--

Sami C.
Sami C.

Written by Sami C.

Freelance Software Engineer

No responses yet