Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Svelte Testing Crash Course - part 15
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
You can’t perform that action at this time.