added jest and a new test

This commit is contained in:
Ken
2019-01-31 16:10:49 -08:00
parent 23aa611fea
commit 260b6177fe
4 changed files with 3485 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
import { reducer } from '../index';
describe('reducers', () => {
it('should add item to the list', () => {
const newStore = reducer({ todos: {}, filter: 'all' }, { type: 'add', label: 'hello' });
const keys = Object.keys(newStore.todos);
expect(keys.length).toBe(1);
expect(newStore.todos[keys[0]].label).toBe('hello');
});
});