npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jasmine-console-reporter

v3.1.0

Published

Console Reporter for Jasmine. Outputs detailed test results to the console, with beautiful layout and colors. This is the default reporter of grunt-jasmine-nodejs.

Downloads

72,448

Readme

jasmine-console-reporter

npm release license downloads dependencies maintained

© 2018, Onur Yıldırım (@onury). MIT License.

Progressive Console Reporter for Jasmine. (for Jasmine v3+)
Outputs detailed test results to the console, with beautiful layout and colors.

Example screen:

Overall summary outputs:

Installation

npm i jasmine-console-reporter --save-dev

JCR v3+ requires peer dependency Jasmine v3+ and works on Node.js v6+. See compatibility table.

Usage

const JasmineConsoleReporter = require('jasmine-console-reporter');
const reporter = new JasmineConsoleReporter({
    colors: 1,           // (0|false)|(1|true)|2
    cleanStack: 1,       // (0|false)|(1|true)|2|3
    verbosity: 4,        // (0|false)|1|2|(3|true)|4|Object
    listStyle: 'indent', // "flat"|"indent"
    timeUnit: 'ms',      // "ms"|"ns"|"s"
    timeThreshold: { ok: 500, warn: 1000, ouch: 3000 }, // Object|Number
    activity: false,     // boolean or string ("dots"|"star"|"flip"|"bouncingBar"|...)
    emoji: true,
    beep: true
});
// pass the initialized reporter to whichever task or host...

Options

| Option | Description | | -------- | ----------- | | colorsNumber\|Boolean | Default: 1. Specifies whether the output should have colored text. Possible integer values: 0 to 2. Set to 1 (or true) to enable colors. Set to 2 to use the ANSI escape codes. Option 2 can be useful if, for example, you're running your tests from a sub-process, and the colors aren't showing up. | | cleanStackNumber\|Boolean | Default: 1. Specifies the filter level for the error stacks. Possible integer values: 0 to 3. Set to 1 (or true) to only filter out lines with jasmine-core path from stacks. Set to 2 to filter out all node_modules paths. Set to 3 to also filter out lines with no file path in it. | | verbosityNumber\|Boolean\|Object | Default: 4. Specifies the verbosity level for the reporter output. Possible integer values: 0 to 4. When a Boolean value is passed, true defaults to 4 and false defaults to 0. Level 0: reports errors only. Level 1: also displays a summary. Level 2: also reports pending specs. Level 3: additionally displays all suites and specs as a list, except disabled and excluded specs. Level 4: lists all. Or set to an object to toggle each output section individually. Any omitted value will default to true. e.g. { pending: false, disabled: false, specs: false, summary: true } | | listStyleString | Default: "indent". Indicates the style of suites/specs list output. Possible values: "flat" or "indent". Setting this to "indent" provides a better view especially when using nested (describe) suites. This option is only effective when verbosity level is set to 3, 4 or true. | | timeUnitString | Default: "ms". Specifies the time unit to be used to measure spec execution. "ms" for milliseconds, "ns" for milliseconds including hi-res nanoseconds remainder, "s" for seconds including milliseconds remainder. Note that overall time in final summary is always reported in seconds.| | timeThresholdNumber|Object | Default: { ok: 500, warn: 1000, ouch: 3000 }. Specifies the expected maximum time(s) (in milliseconds) for any spec to complete its execution. If threshold is exceeded, elapsed time for that spec will be accented in the output. This is only effective if colors option is enabled. | | activityBoolean\|String | Default: false. Specifies whether to enable the activity indicator animation that outputs the current spec that is being executed. Set to a string value to set/change the spinner style.| | emojiBoolean\|Object | Default: false. Whether to output some emojis within the report, for a little fun. To customize emojis, you can set an object. Note that emojis will be auto-disabled in CI environments. | | beepBoolean | Default: true. Whether to play system beep when tests finish with status "failed". Note that beep will be auto-disabled in CI and non-TTY environments. |

Full Example with Jasmine (Node.js)

#!/usr/bin/env node

// setup Jasmine
const Jasmine = require('jasmine');
const jasmine = new Jasmine();
jasmine.loadConfig({
    spec_dir: 'test',
    spec_files: ['**/*[sS]pec.js'],
    helpers: ['helpers/**/*.js'],
    random: false,
    seed: null,
    stopSpecOnExpectationFailure: false
});
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;

// setup console reporter
const JasmineConsoleReporter = require('jasmine-console-reporter');
const reporter = new JasmineConsoleReporter({
    colors: 1,           // (0|false)|(1|true)|2
    cleanStack: 1,       // (0|false)|(1|true)|2|3
    verbosity: 4,        // (0|false)|1|2|(3|true)|4|Object
    listStyle: 'indent', // "flat"|"indent"
    timeUnit: 'ms',      // "ms"|"ns"|"s"
    timeThreshold: { ok: 500, warn: 1000, ouch: 3000 }, // Object|Number
    activity: true,
    emoji: true,         // boolean or emoji-map object
    beep: true
});

// initialize and execute
jasmine.env.clearReporters();
jasmine.addReporter(reporter);
jasmine.execute();

Change-Log

See CHANGELOG.md.

Compatibility Table

| Jasmine Console Reporter | Node | Jasmine | | ------------------------ | -------------- | --------- | | v3.x | v6 and newer | v3.x | | v2.x | v4 and newer | v2.x | | v1.2.7 | below v4 | v2.x |

License

MIT.