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

jshint-reporter-bamboo

v0.1.4

Published

A reporter for gulp-jshint which produces a report compatible with Atlassian Bamboo Mocha Test Parser.

Downloads

108

Readme

jshint-reporter-bamboo

view on npm npm module downloads per month Dependency status Coverage

A reporter for gulp-jshint which produces a report compatible with Atlassian Bamboo Mocha Test Parser.

##Usage

This reporter for gulp-jshint requires an object to store the results of each file analysed by jshint.

As a gulp task

Require this package and use as part of your gulp-jshint task. Pass an empty 'report' object. The report results will be available on report.results.

var JshintReporterBamboo = require('jshint-reporter-bamboo');
var jshint = require('gulp-jshint');
var report = {};
gulp.src('./lib')
.pipe(jshint())
.pipe(new JshintReporterBamboo(report));
.on('end', function() {
    fs.writeFileSync('report.json', JSON.stringify(report.results, null, 2), 'utf-8');
    done();
});

API

#jshint-reporter-bamboo A reporter for gulp-jshint which produces a report compatible with Atlassian Bamboo Mocha Test Parser.

Params

  • reportJSON Object - object to receive the results of the test. The report results will be available on report.results.
  • opts Object - Task configuration options
    • [report='mocha'] string - The test report format to use. Select from 'mocha' or 'cucumber'.
    • [suiteName='JSHint'] string - The test suite name
    • [suiteDesc=''] string - The test suite description

Type: name
Returns: readable-stream/transform
Example
Given the Javascript file:

for (i=0; i < 10; i = i + 1) {
    ctr = ctr + i;
}

When you pass the file to a new JshintReporterBamboo() using an empty 'report' object. The report results will be available on report.results.

var JshintReporterBamboo = require('jshint-reporter-bamboo');
var jshint = require('gulp-jshint');
var report = {};
gulp.src('./lib')
.pipe(jshint())
.pipe(new JshintReporterBamboo(report));
.on('end', function() {
    fs.writeFileSync('report.json', JSON.stringify(report.results, null, 2), 'utf-8');
    done();
});

Then you'll get a jshint mocha formatted report:

{
  "stats": {
    "start": "2014-08-22T06:04:30.645Z",
    "end": "2014-08-22T06:04:30.707Z",
    "suites": null,
    "tests": null,
    "duration": 62,
    "passes": null
  },
  "failures": [],
  "passes": [
    {
      "title": " index.js",
      "fullTitle": " \\jshint-reporter-bamboo\\lib\\index.js",
      "duration": 62
    }
  ],
  "skipped": []
}

When you pass the file to a new JshintReporterBamboo() using options report='cucumber'.

var JshintReporterBamboo = require('jshint-reporter-bamboo');
var jshint = require('gulp-jshint');
var report = {};
gulp.src('./lib')
.pipe(jshint())
.pipe(new JshintReporterBamboo(report, {report:'cucumber'}));
.on('end', function() {
    fs.writeFileSync('report.json', JSON.stringify(report.results, null, 2), 'utf-8');
    done();
});

Then you'll get a jshint cucumber formatted report:

[
  {
    "id": "JSHINT-code-analysis-feature",
    "uri": "features/JSHINT-code-analysis.feature",
    "keyword": "Feature",
    "name": "JSHINT code analysis",
    "line": 1,
    "description": "As a developer\nI want to ensure JSHINT code analysis standards are met\nSo that my code is conformant with technical standards designed to ensure consistency and readability",
    "elements": [
      {
        "id": "index.js",
        "keyword": "Scenario",
        "name": "index.js",
        "line": 3,
        "description": "\\jshint-reporter-bamboo\\lib\\index.js",
        "type": "scenario",
        "steps": [
          {
            "result": {
              "duration": 0,
              "status": "passed"
            },
            "name": "a Javascript file",
            "keyword": "Given ",
            "line": 4
          },
          {
            "result": {
              "duration": 0,
              "status": "passed"
            },
            "name": "analysed using JSHint and the repositories default JSHint configuration file",
            "keyword": "When ",
            "line": 5
          },
          {
            "result": {
              "duration": 0,
              "status": "passed"
            },
            "name": "the file should meet the defined coding standards",
            "keyword": "Then ",
            "line": 6
          }
        ]
      }
    ]
  }
]

documented by jsdoc-to-markdown.

#Changelog

License

MIT License (MIT). All rights not explicitly granted in the license are reserved.

Copyright (c) 2014 John Barry

Dependencies

[email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT*", [email protected] - "BSD", [email protected] - "MIT", [email protected] - ["MIT"], [email protected] - "MIT", [email protected] - "ISC", [email protected] - "MIT", [email protected] - "MIT License (MIT)", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - , [email protected] - "MIT", [email protected] - "MIT*", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - "MIT", [email protected] - ["MIT"], [email protected] - ["MIT"], documented by npm-licenses.