Install jest
(it needs Jest 21+) and jest-runner-stylelint
yarn add --dev jest jest-runner-stylelint
# or with NPM
npm install --save-dev jest jest-runner-stylelint
In your package.json
{
"jest": {
"runner": "jest-runner-stylelint",
"moduleFileExtensions": [
"css"
],
"testMatch": [
"**/*.css"
]
}
}
Or in jest.config.js
module.exports = {
runner: "jest-runner-stylelint",
moduleFileExtensions: [
"css"
],
testMatch: [
"**/*.css"
]
};
yarn jest