Testing
Structuring the app
import { state } from './state'
export const config = {
state
}import { createOvermind } from 'overmind'
import { config } from './overmind'
const overmind = createOvermind(config)Setting initial state
import { createOvermindMock } from 'overmind'
import { config } from './'
describe('State', () => {
test('should derive authors of posts', async () => {
const overmind = createOvermindMock(config, (state) => {
state.posts = { 1: { id: 1, author: 'Janet' } }
})
expect(overmind.state.authors).toEqual(['Janet'])
})
})Testing actions
Testing onInitializeOvermind
Testing effects
Last updated