This file contains hidden or 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 reduce from './reducer' | |
// Use `describe` to group similar tests | |
describe ('REDUCER', () => { | |
// The `it` blocks represent one test and although they can | |
// have several expects it is recommended that you only have one | |
// or that at least all the expects blocks are related, as in this case. | |
it ('should set the right state on "DO_REQUEST"', () => { | |
const newState = reducer(undefined, {type: 'DO_REQUEST'}) | |
expect (newState.error).toBe('') |
This file contains hidden or 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 reduce from './reducer' | |
describe ('REDUCER', () => { | |
it ('should set the right state on "DO_REQUEST"', () => { | |
const newState = reducer(undefined, {type: 'DO_REQUEST'}) | |
// The `toMatchSnapshot` matcher does not receive any parameters | |
// In the next section we will see why | |
expect (newState).toMatchSnapshot() | |
}) | |
}) |
This file contains hidden or 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
exports [`REDUCER should set the right state on" DO_REQUEST "1`] =` | |
Object { | |
"data": Array [], | |
"error": "", | |
"isLoading": true, | |
} | |
` |
This file contains hidden or 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
# Taken from -> https://www.git-tower.com/learn/git/faq/change-author-name-email/ | |
git filter-branch --env-filter ' | |
WRONG_EMAIL="[email protected]" | |
NEW_NAME="YOUR GOOD NAME" | |
NEW_EMAIL="[email protected]" | |
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ] | |
then | |
export GIT_COMMITTER_NAME="$NEW_NAME" | |
export GIT_COMMITTER_EMAIL="$NEW_EMAIL" |
This file contains hidden or 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 path from 'path' | |
import fs from 'fs' | |
const cwd = path.resolve('[YOUR DIR]') | |
const dirs = fs.readdirSync(cwd) | |
const isFile = (baseDir: string) => (dir: string) => | |
fs.lstatSync(path.join(baseDir, dir)).isFile() | |
const and = |
This file contains hidden or 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 VALUES = { | |
I: 1, | |
V: 5, | |
X: 10, | |
L: 50, | |
C: 100, | |
D: 500, | |
M: 1000, | |
} | |
const INIT = { value: 0, prev: 0 } |
OlderNewer