Boiler for basic React Apps. Not strapped with CRA.
Built to better
incorporate testing from the start of a project.
- Medium article on how to build a React App with Babel and Webpack 4 -- by Sukhjinder Arora
- TestingJavaScript.com -- by Kent C. Dodds
- Husky
- Prettier
- ESLint
- Lint-Staged
- Babel
- Webpack
- React
- React-DOM
There are a few custom configured test scripts (with watch, coverage, etc).These
are ready to use or not use.
The Husky pre-commit hook will run
lint-staged which looks to the lintstagedrc file. This will happen on every
commit.
Currently that runs ESLint, Prettier, and Jest tests on staged
files only and will abort the commit if any of them fail.
ESLint and
Prettier look to eslintrc and prettierrc respectively for configuration.
The test script has the Jest coverage flag which can be removed if desired.
jest.config.js has a coverage threshold that only needs un-commented and then
you can set to your specs.
The base_tests file has a few preset tests to help show some of the testing
features included and how they appear in the console. These can be
changed/removed as needed.
The debug() feature is very helpful to
throw into tests and see exactly how the test-DOM looks at that point of the
test, so you can better setup your assertions.