UNPKG

ts-audio

Version:

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

16 lines (12 loc) 375 B
import { EventEmitter } from '../EventEmitter' describe('EventEmitter', () => { test('emit', () => { const emitter = new EventEmitter() const keyEvent = 'decoded' const callback = jest.fn() const param = { data: true } emitter.listener(keyEvent, callback) emitter.emit(keyEvent, { data: true }) expect(callback).toBeCalledWith(param) }) })