Skip to content

ZumDeWald/ReactBoilerplate

Repository files navigation

ReactBoilerplate

Boiler for basic React Apps. Not strapped with CRA.
Built to better incorporate testing from the start of a project.

Much of this project came from these two sources:

  1. Medium article on how to build a React App with Babel and Webpack 4 -- by Sukhjinder Arora
  2. TestingJavaScript.com -- by Kent C. Dodds

Dev Dependencies

Testing Related Dependencies

Tests

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.

Coverage

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.

Base-Tests

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.

About

Boiler for basic React Apps. Not strapped with CRA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published