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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jasmine-line-per-spec-reporter

v0.3.0

Published

Always report one line per spec, regardless of spec status.

Downloads

37

Readme

jasmine-line-per-spec-reporter 0.3.0 (2016-04-20)

Always report one line per spec, regardless of spec status.

Provided as a reporter class for the jasmine test framework.

Example

The output format is:

status-right-padded - spec-number-left-padded/total-spec-count - full suite/spec description
                                                                 indented expect messages
                                                                 are output on FAILURE

Such that output would look like:

Passed   -   1/4 - Suite one Sub-suite AAA Spec one
FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                   Expected 1 to be 0.

Pending  -   3/4 - Suite one Sub-suite BBB Spec three
Disabled -   4/4 - Suite one Sub-suite CCC Spec four

Given these suites/specs:

describe('Suite one', () => {
    describe('Sub-suite AAA', () => {
        it('Spec one', () => {
            expect(0).toBe(0);
        });
    });

    describe('Sub-suite BBB', () => {
        it('Spec two', () => {
            expect(1).toBe(0);
        });

        xit('Spec three', () => {
            expect(0).toBe(0);
        });
    });

    xdescribe('Sub-suite CCC', () => {
        it('Spec four', () => {
            expect(0).toBe(0);
        });
    });
});

Installation

The easiest way is to keep jasmine-line-per-spec-reporter as a devDependency in your package.json. Just run

npm install jasmine-line-per-spec-reporter --save-dev

to let npm automatically add it there.

Configuration

protractor

In your protractor.conf.js file:

  • At the top, or with the other require lines, add:

    const JasmineLinePerSpecReporter = require('jasmine-line-per-spec-reporter');
  • In the config.onPrepare function, add:

        if (browser.params.linePerSpecReporter === true) {
            jasmine.getEnv().addReporter(new JasmineLinePerSpecReporter(jasmine));
        }
  • You can also hide disabled specs. So, if you're using any fdescribe/fit, or disabling remaining lines on failure, you won't see superfluous Disabled lines. In the config.onPrepare function, add:

        if (browser.params.linePerSpecReporter === true) {
            const conifg = {
                hideDisabled: true
            };
            jasmine.getEnv().addReporter(new JasmineLinePerSpecReporter(jasmine, config));
        }

    This will produce output like the following:

    Passed   -   1/4 - Suite one Sub-suite AAA Spec one
    FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                       Expected 1 to be 0.
    
    Pending  -   3/4 - Suite one Sub-suite BBB Spec three
      
    1 disabled spec was hidden
  • You can also see stack trace lines that only match the path to your spec files, without all the extra stack trace junk you get from the default reporter. E.g., If you project root folder is my-project-folder and all your tests are in my-project-folder/test/spec, then in the config.onPrepare function, add:

        if (browser.params.linePerSpecReporter === true) {
            const conifg = {
                failureExpectationMessageSuffixLine: '',
                failureSuffixLine: null,
                showStackTrace: true,
                showStackTraceRegExMatch: /^.*[\\\/](my-project-folder[\\\/]test[\\\/]spec[\\\/].*)\)$/g,
                showStackTraceRegExReplace: '  at $1',
                showStackTraceRegExShowMax: 1
            };
            jasmine.getEnv().addReporter(new JasmineLinePerSpecReporter(jasmine, config));
        }

    This will produce output for each failure showing only the first stack trace line that matches your criteria, like the following:

    Passed   -   1/4 - Suite one Sub-suite AAA Spec one
    FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                       Expected 1 to be 0.
                       Stack trace (replaced lines):
                         at my-project-folder/test/spec/myTest.js:10:8
    
    Pending  -   3/4 - Suite one Sub-suite BBB Spec three
    Disabled -   4/4 - Suite one Sub-suite CCC Spec four

grunt + protractor

If you are using grunt, this configuration will allow you to specify the protractor flag from the grunt command line.

You must modify the protractor configuration in your Gruntfile.js as:

    protractor: {
        options: {
            args: {
                params: {
                    // Map the `grunt` command line argument:
                    //     --linePerSpecReporter=true
                    // to the `protractor` boolean property:
                    //     browser.params.linePerSpecReporter
                    linePerSpecReporter: grunt.option('linePerSpecReporter')
                }
            }
        }
    }

grunt + regular jasmine

TODO

Usage

protractor

Run your usual protractor command with the extra flag:

--params.linePerSpecReporter=true

e.g.:

protractor --params.linePerSpecReporter=true

grunt

Run your usual grunt command with the extra flag:

--linePerSpecReporter=true

e.g.:

grunt test --linePerSpecReporter=true

TODO

  • Needs documentation -- Until fully documented, see defaultConfig in dist/jasmine-line-per-spec-reporter.js for all of the properties that can be set using optionalConfig as:

            jasmine.getEnv().addReporter(new JasmineLinePerSpecReporter(jasmine, optionalConfig));
  • Feature -- Optional time prefixes:

    • Delta -- time between each spec as SS.mmm, e.g.:

      00.000 Passed   -   1/4 - Suite one Sub-suite AAA Spec one
      00.250 FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                                Expected 1 to be 0.
      
      00.133 Pending  -   3/4 - Suite one Sub-suite BBB Spec three
      00.088 Disabled -   4/4 - Suite one Sub-suite CCC Spec four
    • Relative -- time since first spec MM:SS.mmm, e.g.:

      00:00.000 Passed   -   1/4 - Suite one Sub-suite AAA Spec one
      00:00.133 FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                                   Expected 1 to be 0.
      
      00:00.250 Pending  -   3/4 - Suite one Sub-suite BBB Spec three
      00:00.250 Disabled -   4/4 - Suite one Sub-suite CCC Spec four
    • Current -- current time as YYYY-MM-DD HH:MM:SS.mmm, e.g.:

      2016-04-19 16:00:00.000 Passed   -   1/4 - Suite one Sub-suite AAA Spec one
      2016-04-19 16:00:00.133 FAILED   -   2/4 - Suite one Sub-suite BBB Spec two
                                                 Expected 1 to be 0.
      
      2016-04-19 16:00:00.250 Pending  -   3/4 - Suite one Sub-suite BBB Spec three
      2016-04-19 16:00:00.250 Disabled -   4/4 - Suite one Sub-suite CCC Spec four

Changelog / Release History

See CHANGELOG.md.