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

buster-testbed-extension

v0.1.3

Published

Extension for Buster.JS to dynamically add configuration groups for found testbeds at runtime.

Downloads

6

Readme

buster-testbed-extension

Build status

This extension for Buster.JS uses the preConfigure extension hook to dynamically add configuration groups at runtime.

You need version >=0.6.3 of buster-cli to use the extension.

Installation

npm install buster-testbed-extension

Usage

You need at least one configuration group in your Buster.JS configuration file:

var config = module.exports;

config["base"] = {
    environment: "browser",
	extensions: [require("buster-testbed-extension")],
	"buster-testbed-extension": {
		testbeds: ["testbed/**/*.html"],
		tests: ...
	}
};

The given configuration group loads and configures the extension with the following parameters:

testbeds

Array of glob patterns to select the testbeds, for which configuration groups have to be added.

tests

This parameter contains the information needed to create the glob patterns for selecting the corresponding JavaScript test files for the testbeds. Depending on the mode, which should be used, different kinds of informations has to be provided.

Simple mode:

Directory from which to start with the selection of the JavaScript test files.

RegExp mode:

Information about how to modify the testbed path to get the path for the JavaScript test files.

strict: false

By default the extension adds a configuration group for every found testbed. If Buster.JS can't find any javascript test file for a testbed afterwards, it will report that as an error. Specifying the option strict: false instructs the extension, only to add a configuration group for a testbed, if at least one corresponding javascript test file exists for it.

Simple mode

The glob pattern for selecting the JavaScript test files is build by:

  • Take the path of the testbed including the file name.
  • Replace the first part of the path with the path specified by the tests parameter of the extension. The number of subdirectories which are replaced, complies to the number of subdirectories of the path in the tests parameter.
  • Change the extension of the file to js and add an additional asterisk, to allow to have more than one JavaScript test file per testbed.

Example

Directory structure:

├── test/
│   ├── gen/
│   │   ├── timeStructure.html
│   │   ├── time/
│   │       ├── structure/
│   │           ├── timeStructure.html
│   ├── spec/
│       ├── timeStructure-test.js
│       ├── timeStructure-test2.js
│       ├── time/
│           ├── structure/
│               ├── timeStructure-test.js
│               ├── timeStructure-test2.js
├── buster.js

buster.js:

var config = module.exports;

config["base"] = {
    environment: "browser",
	extensions: [require("buster-testbed-extension")],
	"buster-testbed-extension": {
		testbeds: ["test/gen/**/*.html"],
		tests: ["test/spec"]
	}
};

Resulting configuration at runtime:

var config = module.exports;

config["base"] = {
    environment: "browser",
	extensions: [require("buster-testbed-extension")],
	"buster-testbed-extension": {
		testbeds: ["test/gen/**/*.html"],
		tests: ["test/spec"]
	}
};

config["test/gen/timeStructure.html"] = {
    extends: "base",
    testbed: "test/gen/timeStructure.html",
    tests: ["test/spec/timeStructure*.js"]
};

config["test/gen/time/structure/timeStructure.html"] = {
    extends: "base",
    testbed: "test/gen/time/structure/timeStructure.html",
    tests: ["test/spec/time/structure/timeStructure*.js"]
};

RegExp mode

In this mode the tests parameter of the extension is an array of length 2, with first element of type RegExp and second element a string literal.

These elements are used as params for the string.replace method, which is used to transform the path of a testbed to get the path to the corresponding JavaScript test files.

Example

Directory structure:

├── test/
│   ├── testbeds/
│   │   ├── gen/
│   │       ├── timeStructure.html
│   │       ├── time/
│   │           ├── structure/
│   │               ├── timeStructure.html
│   ├── spec/
│       ├── timeStructure-test.js
│       ├── timeStructure-test2.js
│       ├── time/
│           ├── structure/
│               ├── timeStructure-test.js
│               ├── timeStructure-test2.js
├── buster.js

buster.js:

var config = module.exports;

config["base"] = {
    environment: "browser",
	extensions: [require("buster-testbed-extension")],
	"buster-testbed-extension": {
		testbeds: ["test/testbeds/gen/**/*.html"],
		tests: [/^test\/testbeds\/gen/, "test/spec"]
	}
};

Resulting configuration at runtime:

var config = module.exports;

config["base"] = {
    environment: "browser",
	extensions: [require("buster-testbed-extension")],
	"buster-testbed-extension": {
		testbeds: ["test/testbeds/gen/**/*.html"],
		tests: [/^test\/testbeds\/gen/, "test/spec"]
	}
};

config["test/testbeds/gen/timeStructure.html"] = {
    extends: "base",
    testbed: "test/testbeds/gen/timeStructure.html",
    tests: ["test/spec/timeStructure*.js"]
};

config["test/testbeds/gen/time/structure/timeStructure.html"] = {
    extends: "base",
    testbed: "test/testbeds/gen/time/structure/timeStructure.html",
    tests: ["test/spec/time/structure/timeStructure*.js"]
};

##Changelog

0.1.3 (14.07.2015)

0.1.2 (25.09.2014)

0.1.1 (24.09.2014)