Created
July 22, 2020 16:21
-
-
Save sonicoder86/97179c47a33ab9f7bbd28a241d8df81a to your computer and use it in GitHub Desktop.
Svelte Testing Crash Course - part 15
This file contains hidden or 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
it('should set info coming from endpoint', async () => { | |
const commit = jest.fn(); | |
jest.spyOn(axios, 'post').mockImplementation(() => ({ | |
body: 'Modified by post' | |
})); | |
const { store, onModify } = createStore(); | |
let info; | |
store.subscribe(value => info = value); | |
await onModify('Modified by click'); | |
expect(info).toEqual('Modified by post'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment