UNPKG

ts-audio

Version:

`ts-audio` is an agnostic and easy-to-use library to work with the `AudioContext` API and create Playlists.

20 lines (15 loc) 503 B
import Audio from '../Audio' const audioCtxMock = {} as AudioContext jest.mock('../AudioCtx', () => ({ AudioCtx: jest.fn().mockImplementation(() => audioCtxMock), })) describe('audio', () => { it('should audio object be defined', () => { expect(Audio).toBeDefined() }) it('should export the audio context object as a read-only property', () => { const audio = Audio({ file: 'test.mp3' }) expect(audio.audioCtx).toBeDefined() expect(audio.audioCtx).toBe(audioCtxMock) }) })