Download react-boilerplate/internals/templates/utils/tests/checkStore.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 881 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/templates/utils/tests/checkStore.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/internals/templates/utils/tests/checkStore.test.js
-
curl -L -o checkStore.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/internals/templates/utils/tests/checkStore.test.js
881 Bytes
| /** | |
| * Test injectors | |
| */ | |
| import checkStore from '../checkStore'; | |
| describe('checkStore', () => { | |
| let store; | |
| beforeEach(() => { | |
| store = { | |
| dispatch: () => {}, | |
| subscribe: () => {}, | |
| getState: () => {}, | |
| replaceReducer: () => {}, | |
| runSaga: () => {}, | |
| injectedReducers: {}, | |
| injectedSagas: {}, | |
| }; | |
| }); | |
| it('should not throw if passed valid store shape', () => { | |
| expect(() => checkStore(store)).not.toThrow(); | |
| }); | |
| it('should throw if passed invalid store shape', () => { | |
| expect(() => checkStore({})).toThrow(); | |
| expect(() => checkStore({ ...store, injectedSagas: null })).toThrow(); | |
| expect(() => checkStore({ ...store, injectedReducers: null })).toThrow(); | |
| expect(() => checkStore({ ...store, runSaga: null })).toThrow(); | |
| expect(() => checkStore({ ...store, replaceReducer: null })).toThrow(); | |
| }); | |
| }); | |