This sample demonstrates integration of neutrinojs with react ,jest, webpack, babel and eslint.
This demo is a very basic scafolding of a react project with integration of neutrinojs. Neutrinojs levearges the existing configuration provided by these modules jest , webpack , eslint and babel respectfully.
Neutrinojs is sugested by React
This is the hello world version which would provide you the integration out of the box for react and jest. This is as prescribed on the official site here.
// .neutrinorc.js
const react = require('@neutrinojs/react');
const jest = require('@neutrinojs/jest');
module.exports = {
use: [
react(),
jest()
]
}
This will allow the customizations that may be required in future for your particular organization or use case scenario. I have provided below the configuration which i needed for my day to day development. You can use the provided configuration as a base .
Core Neutrino configuration is in the .neutrinorc file . see below:
There was some additional configuration required for jest test cases to be functional these are shown below
This is pretty much standard configuration. Only additional configuration was to ignore the false positives (namely errors in the test code and some warnings) which are shown in the image below.
This is intended to be a guide for integration of neutrinojs with react, babel, webpack, eslint and jest.The motivation is to share this possible resolution which was achieved with significant research and effort.
This effort was originall started to resolve the "Module parse failed: Unexpected token" error. see image below.
- Jest code coverage option is not functional . The covearge report is generated but it is empty. This is under investigation