idangoldman / jest-runner-sass-true

SASS True Runner for Jest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jest-runner-sass-true

SASS True Runner for Jest

🚧 Work in Progress 🚧

Usage

Install

Install jest, and jest-runner-sass-true, sass-true

yarn add --dev jest jest-runner-sass-true sass-true
# or with NPM
npm install --save-dev jest jest-runner-sass-true sass-true

Add it to your Jest config

In your package.json

{
  "jest": {
    "projects": [
      {
        "runner": "jest-runner-sass-true",
        "displayName": "SASS",
        "moduleFileExtensions": ["scss"],
        "testMatch": [
          "<rootDir>/src/**/__tests__/*.scss"
        ],
        "testPathIgnorePatterns": [
          "/node_modules/"
        ],
        "globals": {
          "//": "Change to `true` to see the trace log",
          "trace": false
        }
      }
    ]
  }
}

Or in jest.config.json

module.exports = {
  "projects": [
    {
      "runner": "jest-runner-sass-true",
      "displayName": "SASS",
      "moduleFileExtensions": ["scss"],
      "testMatch": [
        "<rootDir>/src/**/__tests__/*.scss"
      ],
      "testPathIgnorePatterns": [
        "/node_modules/"
      ],
      "globals": {
        "//": "Change to `true` to see the trace log",
        "trace": false
      }
    }
  ]
}

Run Jest

yarn jest
# or with config file
jest --config ./jest.config.json

About

SASS True Runner for Jest


Languages

Language:JavaScript 100.0%