Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('MusicPlayerService | tooglePlayPause when is not playing and no track loaded and error loading track | reject is called', () => {
let musicPlayerService = new MusicPlayerService();
let newQueue = [new Track({ id: '2', path: 'some path' })];
let error = 'mock error';
Sound.mockSetError(error);
expect.assertions(1);
return musicPlayerService.setQueue(newQueue)
.then(returnedQueue => {
musicPlayerService.togglePlayPause()
}).catch((err) => {
expect(err).toEqual(error);
});
});