From 75e4ab71a25e9966a7e49d07cc38886a4fd57dc7 Mon Sep 17 00:00:00 2001 From: Andre Christoga Pramaditya Date: Fri, 25 Mar 2022 22:40:17 +0700 Subject: [PATCH] feat(jest): 100% coverage for libraries/SoundManager/SoundManager --- libraries/SoundManager/SoundManager.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/SoundManager/SoundManager.test.ts b/libraries/SoundManager/SoundManager.test.ts index 7fb6cc1071..51a615b7c2 100644 --- a/libraries/SoundManager/SoundManager.test.ts +++ b/libraries/SoundManager/SoundManager.test.ts @@ -1,3 +1,4 @@ +import { Howler } from 'howler' import SoundManager, { Sounds } from './SoundManager' describe('init', () => { @@ -80,4 +81,12 @@ describe('Manage sounds', () => { expect(spy).toHaveBeenCalled() expect(result).toMatchSnapshot() }) + + test('set mute sounds', () => { + const spy = jest.spyOn(Howler, 'mute') + inst.setMuteSounds(false) + + expect(spy).toHaveBeenCalled() + expect(spy).toHaveBeenCalledWith(false) + }) })