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

test-filter

v0.0.1

Published

Filter which tests are executed by integrating issue management systems

Downloads

7

Readme

test-filter

Filter which tests are executed by integrating issue management systems. Uses javadoc-style annotations to associate tests/specs with issues and their current status and target release/milestone.

The system adds annotations such as @status open and @release 1.2.3 to suite/test/spec annotated with an issue. You can also add these annotations directly to your specs, and the system will update them if you also have an issue annotation on the same spec. Unless you explicitly specify a target release on the command line the system will use the version specified in package.json. These annotations are used to filter out tests that you don't want to be run.

You can also execute only tests that relate to a specific issue by providing the issue=123 argument on the command line.

Currently only Jasmine and Karma are supported. If you're using Cucumber on a java project you might be interested in cucumber-jira and jira-maven-plugin's generate-tests goal.

Usage

This module uses the "bugs": {"url": "XXX" value in your package.json file to determine how to connect to the issue management system.

Jasmine

Test Filter can be used as a Jasmine wrapper:

test-filter jasmine

For details on the optional arguments see below.

Add javadoc-style annotations to your spec files:

/**
 * @issue 1
 */
describe('Test suite for Issue 1', function() {
   /**
    * @issue 2
    */
    it('should skip this test if either issue 1 or 2 are open', function() {
    });
});

Karma

Test-filter can also be used as a Karma preprocessor:

test-filter karma [start|run [karma.conf.js] issue=123|release=1.2.3]

For details on the optional arguments see below.

karma.conf.js

module.exports = function(config) {
    config.set({
        frameworks: ['jasmine'],
        ...
        plugins: [
            'karma-jasmine',
            {'preprocessor:test-filter': ['factory', require('test-filter/lib/tools/karma/karma-test-filter-preprocessor')]}
        ],
        preprocessors: {
            '**/*-spec.js': ['test-filter']
        }

Optional Arguments

  • --offline - If you're unable to connect to the issue management system
  • --preserve-specs - By default test-filter will add & update the annotations in your spec files.
  • group=xxx and repo=yyy - Not required for GitHub and BitBucket
  • release=1.2.3 - By default test-filter will use the version in your package.json file, along with the target release/milestone of each issue to determine which tests to run/skip.
  • issue=123 - Run only issues associated with a specific issue.
  • system=jira - is only required if bugs.url is not specified in package.json and the URL does not imply the system used. Valid values: 'github' or 'bitbucket'.

GitHub

  • timeout=60000 - Timeout in ms (defaults to 5 seconds)
  • host=issues.domain.com and pathPrefix=prefix - Only required for GitHub Enterprise

BitBucket

When connecting to BitBucket, you must provide your BitBucket username & password on the command line:

test-filter jasmine username=someone password=secret

JIRA

Not yet implemented