1.0.1 • Published 6 years ago

jest-reporter v1.0.1

Weekly downloads
116
License
MIT
Repository
github
Last release
6 years ago

Custom Jest Reporter (jest-reporter)

Jest Reporter with customisable sounds and messages.

Build Status Dependencies devDependencies

Installing

npm install --save-dev jest-reporter

or

yarn add -D jest-reporter

Getting Started

To use this reporter you will need to have an Jest test environment set up. In your package.json add new reporter:

"jest": {
  "bail": false,
  "reporters": [
    "default",
    [
      "<rootDir>/node_modules/jest-reporter", {
        "passSound": "sounds/customPass.wav",
        "failSound": "sounds/customFail.wav",
        "passText": "txt/customPass.txt",
        "failText": "txt/customFail.txt",
        "skipFailSound": false,
        "skipFailText": false,
        "skipPassSound": false,
        "skipPassText": false
      }
    ]
  ]
}

Options

OptionValueDescription
passSoundstringPath to sound file e.g "sounds/pass.wav"
failSoundstringPath to sound file e.g "sounds/fail.wav"
passTextstringPath to text file e.g "txt/pass.txt"
failTextstringPath to text file e.g "txt/fail.txt"
skipFailSoundbooleanSet to true if you want to disable sound effect on failed test
skipFailTextbooleanSet to true if you want to disable text message on failed test
skipPassSoundbooleanSet to true if you want to disable sound effect on passed test
skipPassTextbooleanSet to true if you want to disable text message on passed test

If you not specify sound or text files, default ones will be used.

Run

npm run jest or yarn jest

Demo

You can even add ASCII images in txt files ;)

npm.io

npm.io

Windows users

You need "mplayer" installed on your system

Tip: Copy mplayer.exe into folder with package.json

LICENSE

MIT