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
"format": "echo 'Linting ...' && npm run -s lint --fix && echo 'Lint complete.'", | |
"lint": "eslint --ignore-path .gitignore .", | |
"test": "NODE_ENV=test riteway -r @babel/register 'src/**/*.test.js'", | |
"watch": "watch 'clear && npm run -s test | tap-nirvana && npm run -s format' src" |
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
{ | |
"env": { | |
"test": { | |
"plugins": [ | |
[ | |
"module-resolver", | |
{ | |
"root": [ | |
"." | |
], |
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
{ | |
"arrowParens": "avoid", | |
"bracketSpacing": true, | |
"htmlWhitespaceSensitivity": "css", | |
"insertPragma": false, | |
"jsxBracketSameLine": false, | |
"jsxSingleQuote": false, | |
"printWidth": 80, | |
"proseWrap": "always", | |
"quoteProps": "as-needed", |
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"node": true | |
}, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", |
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
{ | |
"compilerOptions": { | |
"baseUrl": "./src" | |
} | |
} |
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
// root-reducer.js | |
const rootReducer = combineReducers({ /* ... */ }); | |
const rootState = rootReducer(undefined, {}); | |
export { rootReducer, rootState }; | |
// in counter-reducer.test.js | |
import { rootReducer, rootState } from 'redux/root-reducer.js'; | |
import { setOffset } from 'features/offset/offset-reducer.js'; |
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 summand = 1; | |
const state = createPopulatedState(); | |
assert({ | |
given: 'state with a count and an increment by action', | |
should: 'increment the count by the payload', | |
actual: reducer(state, incrementBy(summand)), | |
expected: createPopulatedState({ count: 42 /* , ... rest untouched */ }), | |
}); |
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
// 👇 Avoid exporting your initial state 🚫 | |
export const initialState = { | |
wrongKey: 'foo', | |
correctKey: 'wrong value' | |
/* missing keys ... */ | |
}; | |
assert({ | |
given: 'no arguments', | |
should: 'return the valid initial state', |
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 { combineReducers } from 'redux'; | |
import { describe } from 'riteway'; | |
const slice = 'count'; | |
const initial = { | |
count: 0, | |
}; | |
const incrementBy = payload => ({ type: incrementBy.type, payload }); | |
incrementBy.type = `${slice}/incrementBy`; |
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
name: Master - Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
re-check: | |
strategy: | |
fail-fast: false | |
matrix: |