Hi Jest's guys, how are you?
I'd like to use Jest snapshots for my reducers (not only for my .jsx components).
The test would be something like:
describe.only('Dialog Reducer', () => {
test(type.DIALOG_START, () => {
expect(
dialog('Test one', {
type: type.DIALOG_START
})).toEqual({
active: true,
text: 'Hi mom'
});
});
test(type.DIALOG_END, () => {
expect(
dialog('Test two', {
type: type.DIALOG_END
})).toMatchSnapshot();
});
});
There are two tests inside one script. The snapshot would be something like:
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Dialog Reducers DIALOG_START`] = `
Object {
"active": false,
"text": 'Hi Mom',
}
`;
exports[`Dialog Reducers DIALOG_END`] = `
Object {
"active": false,
"text": null,
}
`;
Suppose that both tests fail I would fix them one by one. After every fix I might need to update the snapshot just for one test. But it looks like there isn't this chance because the command update the entire snapshot.
http://facebook.github.io/jest/docs/cli.html#updatesnapshot
Hi Jest's guys, how are you?
I'd like to use Jest snapshots for my reducers (not only for my .jsx components).
The test would be something like:
There are two tests inside one script. The snapshot would be something like:
Suppose that both tests fail I would fix them one by one. After every fix I might need to update the snapshot just for one test. But it looks like there isn't this chance because the command update the entire snapshot.
http://facebook.github.io/jest/docs/cli.html#updatesnapshot