Coder Social home page Coder Social logo

mikeerickson / mocha-better-spec-reporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from btd/mocha-better-spec-reporter

0.0 2.0 0.0 47 KB

Just a fork of mocha spec reporter, but with small goodies

License: MIT License

JavaScript 100.00%

mocha-better-spec-reporter's Introduction

mocha-better-spec-reporter

Originally it was fork for mocha own spec reporter, but it is very inconvenient to use.

Why i made fork:

  • It is possible to hide/show any part of report
  • It is possible to see where error happen - not only stack line but also relevant file content
  • It supports source maps
  • It does not show useless stack lines

Env variables usage

It is possible to hide additional stack traces via env variable MOCHA_REPORTER_STACK_EXCLUDE as glob string.

**/yadda/lib/** - will hide all of the yadda stack traces

It is possible to hide some parts of output via env variable MOCHA_REPORTER_OPTS.

hide-titles - will hide execution tests/suites titles

hide-stats - will hide stat

clear-screen - will clear the screen on start

show-back-order - will show fails in back order

Command line usage

Also it is possible to set this parameters with mocha command line option --reporter-options, e.g:

mocha -R ../../../ --reporter-options hide-stats=true,hide-titles=true test.js

You need to set options in such format A=B,C=D.... Options are:

hide-titles accepted values true|false - show/hide executed test/suites titles (default false)

hide-stats accepted values true|false - show/hide executed tests statistic (default false)

clear-screen accepted values true|false - clear the screen before executing tests (default false)

show-back-order accepted values true|false - test fails shown in back order, so first fail will be at the bottom (default true)

stack-exclude any glob string, used to match stack trace files for exclude

show-file-content it can be js or js+sm or sm, meaning what to show if available (sm - source-mapped files, js - actual files) by default it is sm

How to use

npm install --save-dev mocha-better-spec-reporter
mocha --reporter mocha-better-spec-reporter ... # and other options there
mocha -R mocha-better-spec-reporter --reporter-options hide-stats=true,hide-titles=true ...

Screenshot

screenshot

Windows Users Note

This reporter uses chalk for colors, which works very bad in windows environment (usually it just disable colors). If you are sure your terminal supports ansi colors (git for windows, cygwin, cmder, mingw/mingw64 etc) you can force chalk to output colors with adding --color option to your argv. Also you can set env variable FORCE_COLOR to any value.

mocha-better-spec-reporter's People

Contributors

btd avatar mikeerickson avatar hastebrot avatar neveri avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.