This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d22f3e8d4bbd6c06559f9f14f39f27ba79b64252 Mon Sep 17 00:00:00 2001 | |
From: Steve Dodier-Lazaro <sidnioulz@gmail.com> | |
Date: Thu, 22 Jan 2015 02:21:37 +0000 | |
Subject: [PATCH] Prevents passing wrong types to Bn constructors. Fixes issue | |
#2 | |
--- | |
petlib/bn.py | 2 ++ | |
1 file changed, 2 insertions(+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ea29d4381fb2c10835b11f5ec7d67a438278db0d Mon Sep 17 00:00:00 2001 | |
From: Steve Dodier-Lazaro <sidnioulz@gmail.com> | |
Date: Thu, 22 Jan 2015 15:50:31 +0000 | |
Subject: [PATCH] First attempt at a Markdown documentation | |
--- | |
Lab01Basics/Lab01Readme.txt | 202 ------------------------------------------- | |
Lab01Basics/README.md | 203 ++++++++++++++++++++++++++++++++++++++++++++ | |
README.md | 9 ++ | |
3 files changed, 212 insertions(+), 202 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Saga | |
function* doStuffThenChangeColor() { | |
yield put(doStuff()); | |
yield put(doStuff()); | |
const action = yield take(CHOOSE_NUMBER); | |
if (action.payload.number % 2 === 0) { | |
yield put(changeUI('red')); | |
} else { | |
yield put(changeUI('blue')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function configureStore(someSaga, someReducer, initialState = {}) { | |
const dispatched = [] | |
const sagaMiddleware = createSagaMiddleware({ | |
sagaMonitor: { | |
actionDispatched: (action) => dispatched.push(action), | |
}, | |
}) | |
const store = createStore(moduleReducer, initialState, applyMiddleware(sagaMiddleware)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('loginSaga', () => { | |
it('logs a user in when the email and password are recognised', async () => { | |
const { store, dispatched } = configureStore() | |
/* Arrange */ | |
const expirationDate = getFutureDate({ minute: 15 }) | |
mockAxiosSuccess({ expirationDate }) // /auth/login | |
mockAxiosSuccess(annieErnaux) // /auth/fetchCurrentUser | |
/* Act */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
jest.mock('axios') | |
export const mockAxiosSuccess = (data, status = 200) => { | |
axios.mockResolvedValueOnce({ data, status }) | |
} | |
export const mockAxiosFailure = (data, status = null) => { | |
axios.mockRejectedValueOnce({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { waitFor } from '@testing-library/react' | |
export const expectAction = async (dispatched, action) => { | |
await waitFor(() => expect(dispatched[dispatched.length - 1]).toMatchObject(action)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DynamicModuleLoader } from 'redux-dynamic-modules' | |
import React from 'react' | |
import { startup } from 'modules/auth/actions/authActions' | |
import authReducer from 'modules/auth/reducers/authReducer' | |
import redirectReducer from 'modules/redirect/reducers/redirectReducer' | |
import authSaga from 'modules/auth/sagas/authSaga' | |
import redirectSaga from 'modules/redirect/sagas/redirectSaga' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Auth = lazy(() => import(/* webpackPrefetch: true */ 'modules/auth')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function makeTestRunner(dynamicModule) { | |
const moduleReducer = combineReducers(dynamicModule.reducerMap) | |
function* moduleTestSaga() { | |
for (const saga of dynamicModule.sagas) { | |
yield fork(saga) | |
} | |
} | |
return function configureStore(initialState = {}) { |
OlderNewer