Spec Task Deprecation - Sage/carbon-factory GitHub Wiki
In Carbon Factory version 2 we switched from using Karma to using Jest. Jest requires a lot less configuration, so the spec task we provided ended up being nothing more than a shallow interface with the Jest CLI. Instead we can rely solely on the Jest CLI directly.
Carbon Factory will still manage versions and provide a base Jest config to inherit from. It will also still provide a Lint task, to accommodate for error thresholds - however this will be deprecated and removed in the next version of Carbon Factory and instead you should look to use ESLint directly.
To update your builds to not use the gulp task we recommend the following:
- Create a
jest.config.js
file in the root of your project. See the official docs for more information. - Set a preset to use the config supplied by Carbon Factory:
preset: './node_modules/carbon-factory/jest.conf.json'
- Set the following scripts up in your
package.json
:
"scripts": {
"jest": "./node_modules/.bin/jest",
"lint": "./node_modules/.bin/eslint",
"test": "node --inspect=0.0.0.0:9229 ./node_modules/.bin/jest --watch"
}
Your build should be a combination of npm run jest
and npm run lint
.