Created
May 17, 2020 07:16
-
-
Save reciosonny/767d837017ed581012a149e4443aa874 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SoundPlayer from './sound-player'; | |
const mockPlaySoundFile = jest.fn(); | |
jest.mock('./sound-player', () => { | |
return jest.fn().mockImplementation(() => { | |
return {playSoundFile: mockPlaySoundFile}; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sound-player.js | |
export default class SoundPlayer { | |
constructor() { | |
this.foo = 'bar'; | |
} | |
playSoundFile(fileName) { | |
console.log('Playing sound file ' + fileName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment