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

benderjs

v0.4.6

Published

The anti-human approach to JavaScript testing

Downloads

223

Readme

Build Status NPM Version Dependency Status devDependency Status

Bender.js

The anti-human approach to JavaScript testing.

Installation

To install Bender.js locally use:

$ npm install benderjs

To simplify your work with Bender.js we highly encourage you to use benderjs-cli module that registers bender command.

Warning: All the following code samples assume you have benderjs-cli installed globally:

$ [sudo] npm install benderjs-cli -g

Getting started

To get more insight into testing with Bender, check the Testing in Bender wiki page.

If you prefer to see Bender in action, have a look at the example project showing how to configure Bender and use it to run tests written in Jasmine.

Configuration

In order to configure Bender.js for your project, you need to create a configuration file.

Use bender init command to create Bender configuration file and its local .bender/ directory.

Below is an empty configuration file:

/**
 * Bender configuration file
 *
 * @param {Object}   applications       Applications used in current project
 * @param {Array}    browsers           List of browsers used for testing
 * @param {Number}   captureTimeout     Timeout before which a launched browser should connect to the server
 * @param {String}   certificate		Location of the certificate file
 * @param {Boolean}  debug              Enable debug logs
 * @param {Number}   defermentTimeout	Timeout before which a plugin should finish initializing on a test page
 * @param {String}   framework          Default framework used for the tests
 * @param {String}   hostname           Host on which the HTTP and WebSockets servers will listen
 * @param {Array}    manualBrowsers     List of browsers accepting manual tests
 * @param {Number}   manualTestTimeout  Timeout after which a manual test is marked as failed
 * @param {Array}    plugins            List of Bender plugins to load at startup (Required)
 * @param {Number}   port               Port on which the HTTP and WebSockets servers will listen
 * @param {String}   privateKey			Location of the private key file
 * @param {Boolean}  secure				Flag telling whether to serve contents over HTTPS and WSS
 * @param {Number}   slowAvgThreshold   Average test case duration threshold above which a test is marked as slow
 * @param {Number}   slowThreshold      Test duration threshold above which a test is marked as slow
 * @param {String}   startBrowser       Name of a browser to start when executing bender run command
 * @param {Number}   testRetries        Number of retries to perform before marking a test as failed
 * @param {Object}   tests              Test groups for the project (Required)
 * @param {Number}   testTimeout        Timeout after which a test will be fetched again
 */

var config = {
	// put your configuration here
};

module.exports = config;

For more information on Bender configuration, check out the Wiki - Configuration page.

Usage

Type bender to see available commands:

Usage: bender <command> [options]

Commands:

  clean    Clean all Bender.js local files except the configuration
  init     Initialize Bender.js for this directory
  run      Run the tests in a browser and output the results to the console
  server   Handle Bender.js server

Options:

  -c, --config    Alternative path to Bender.js configuration file [bender.js]
  -d, --debug
  -H, --hostname  Hostname used to run the server
  -p, --port      Port on which the server will listen
  -v, --version   Print Bender.js version

In order to run Bender in your project, open the console in project's directory and type:

$ bender server run

This will start the server in the verbose mode.

Now open a web browser. By default, Bender.js dashboard is available under:

http://localhost:1030

If you configured Bender.js to serve contents over HTTPS, use:

https://localhost:1030

Note: You can also run the server as a daemon:

bender server start

At the moment, starting a daemon is supported on Unix systems only.

If you want, you can specify a port or a hostname where Bender.js runs:

-p, --port      The port on which the server will run (default: 1030).
-H, --hostname  The hostname used to run the server (default: 0.0.0.0).

For more information on Bender command line interface, check out the Wiki - Command line page.

Running tests for Bender.js

$ npm install
$ npm test

To get the code coverage report run:

$ npm test --coverage

A detailed report will be created in ./coverage/lcov-report/index.html file.

Development

If you are interested in developing Bender, enable git hooks:

$ ./move-hooks

License

For license details see: LICENSE.md.