DefinitelyTyped/types/multireducer/multireducer-tests.ts
Ben Lichtman 91f680205a
Revert "[assert] Add support for TypeScript's Assertion Functions" (#41916)
* Revert "[assert] Add support for TypeScript's Assertion Functions (#41616)"

This reverts commit 1eb97992fe.

* Update oracledb tests
2020-01-28 11:09:29 -08:00

27 lines
625 B
TypeScript

import multireducer from 'multireducer';
import { deepEqual } from 'assert';
const initialState = { a: 1, b: 2, c: 3 };
const first = (state = initialState, action = {}) => {
return { ...state, a: 10 };
};
const second = (state = initialState, action = {}) => {
return { ...state, b: 20 };
};
const third = (state = initialState, action = {}) => {
return { ...state, c: 30 };
};
const reducers = multireducer({ first, second, third })(undefined, {});
const expectedResult = {
first: { a: 10, b: 2, c: 3 },
second: { a: 1, b: 20, c: 3 },
third: { a: 1, b: 2, c: 30 }
};
deepEqual(reducers, expectedResult);