I explained how I use
npm to configure a working environment, where
all Babel and editor related configuration files are automatically
created with my defaults.
I decided to go a step further and updated project mai-chai to version 2.
mai-chai to a project with:
npm install --save-dev mai-chai
It also creates a
./test folder with
mocha.opts and the
test-helper.js helper file (which gets required automatically
into every test file), so that
are available in the test environment.
My good friend Wallaby
I am also using Wallaby.js extensively
from both the atom and the Visual Studio Code editors.
Wallaby.js needs a configuration file which describes where the
source is located, what should be run as tests and some gory
startup code needed to work well with
React and with
Since v2 of mai-chai, a preconfigured
is automatically copied to the root of the project. For this
to work, the project has to adhere to the following conventions:
./srccontains the source code of the project.
./src.testcontains the tests for the project.
./testcontains the configuration for
Artifacts get compiled by Babel and copied to
the source) and
./lib.test (for the tests).
Starting a new project
My process for creating a new project now looks like this:
cd foo npm init npm install --save-dev generic-js-env babel-env mai-chai
To see a basic example of such a project, where I have added manually:
can be found here.