Git Product home page Git Product logo

karma-helpful-reporter's Introduction

npm version Build Status Coverage Status Code Climate Dependency Status

karma-helpful-reporter

Karma Helpful Reporter gives you a customizable report after you run your Karma tests.

karma-helpful-reporter

The errors from failed tests are displayed hierarchically based on the test suite and nesting level. console.log() messages are output at the bottom below the test summary and grouped by browser.

Setup & Options

Install with npm:

npm install --save-dev karma-helpful-reporter

Inside your karma.conf.js

  • add require('karma-helpful-reporter') to the plugins array
  • add 'helpful' to the reporters array

Optionally, add the helpfulReporter object with as many properties from the below set as you'd like.

  • The listed properties' values are the default ones
// karma.conf.js
module.exports = function(config) {
  config.set({
    plugins: [ require('karma-helpful-reporter') ],
    reporters: [ 'helpful' ],

    // Optional reporter settings
    helpfulReporter: {
      animationStyle: 'braille',
      clearScreenBeforeEveryRun: false,
      hideBrowser: false,
      maxLogLines: 42,
      removeLinesContaining: [],
      removeTail: false,
      renderOnRunCompleteOnly: false,
      suppressErrorReport: false,
      underlineFileType: '',
      colorBrowser: 205,
      colorConsoleLogs: 45,
      colorFail: 9,
      colorFirstLine: 211,
      colorLoggedErrors: 250,
      colorPass: 10,
      colorSkip: 11,
      colorTestName: 199,
      colorUnderline: 254,
    }
  });
};
Property Default Description
animationStyle 'braille' Set in-progress animation to 'braille', 'braille2', or emoji 'clock'.
clearScreenBeforeEveryRun false Clear screen before every run
hideBrowser true Hide browser name from the report
maxLogLines 42 Limit the maximum number of lines in report
removeLinesContaining [] Remove all lines from the final report containing any of these strings, e.g. ['@angular', 'zone.js']
removeTail false Remove from the final report anything that follows '<-', e.g. blah blah <- test.ts 4250:39 becomes blah blah
renderOnRunCompleteOnly false Do not animate while tests are running
suppressErrorReport false Suppress the error report at the end of the test run
underlineFileType '' Underline filename of some file type; all files in the error report that have this particular extention will be underlined, e.g. 'spec.ts'; set the color with the colorUnderline property
colorBrowser 224
colorConsoleLogs 45
colorFail 210
colorFirstLine 217
colorLoggedErrors 250
colorPass 154
colorSkip 117
colorTestName 210
colorUnderline 255

Set custom colors by using permitted cli-color numbers.

Notes

This project was copied from karma-nyan-reporter in July 2017 with intent to build on and improve its functionality. Code cleanup and refactoring will happen during August 2017.

karma-helpful-reporter's People

Contributors

ashwell avatar atomicframeworks avatar dgarlitt avatar idiotwu avatar koba04 avatar lpww avatar thammin avatar whyboris avatar yhnavein avatar

Watchers

 avatar  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.