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

reftest-runner

v0.7.0

Published

Reftest runner with WebDriver API.

Readme

Reftest-runner Build Status

A visual testing tool for Browser(HTML).

overview

from reftest-runner-overview.pdf.

reftest-runner is similar testing tools to Layout Engine Visual Tests (reftest).

Layout Engine Visual Tests (reftest) is adopted major browser Firefox, Chrome, Safari etc.

reftest-runner concept is the same, but use it with any browser that supported WebDriver API.

A reftest is a test that compares the visual output of one file (the test case) with the output of one or more other files (the references). The test and the reference must be carefully written so that when the test passes they have identical rendering, but different rendering when the test fails.

Installation

npm install reftest-runner

Require Node.js v4 >=

Feature

  • Compare the visual output of HTMLs.
    • for testing Canvas, HTML, CSS etc..
  • Compare the visual output of browsers.
    • e.g.) Firefox vs Chrome.
  • Output diff image
    • mismatch the visual, then output diff image of these.
  • Output test result as TAP format.
  • reftest.list support
  • WebDriver API support
    • This tools running on Firefox/Chrome/IE/PhantomJS and more?

Usage

Command line

npm install reftest-runner -g

If you want to compare path/to/fileA.html and path/to/fileB.html using phantomjs.

$ reftest-runner --browser "phantomjs" --targetA path/to/fileA.html --targetB path/to/fileB.html

also use reftest.lit file for test.

$ reftest-runner --list path/to/reftest.list

You can view about reftest.list format on azu/reftest-list-parser.

Command line help

reftest-runner [options]

Options:
  -h, --help                Show help
  -l, --list path::String   Use reftest list from this file
  --targetA path::String    Use a specific test html file
  --targetB path::String    Use a specific test html file
  -v, --version             Outputs the version number
  -b, --browser String      Specify Browser - default: phantomjs
  --compareOperator String  Specify compareOperator. == OR != - default: ==
  --useExternalServer       Use external server url

Command line interface is limited.

if you want to flexibility, please suggestion to issue or use it as node modules.

Node modules

Please see the Examples. :bulb:

reftest-runner export Engine and Runner.

  • Engine is wrapper of Runner for treating multiple files and using local server...
  • Runner is core module.
module.exports = {
    Engine: require("./reftest-engine"),
    Runner: require("./reftest-runner")
};

Example: Programmatic run test with reftest.list

var path = require("path");
var Promise = require("bluebird");
var ReftestEngine = require("reftest-runner").Engine;
// options
// see https://github.com/azu/reftest-runner/blob/master/typings/reftest-runner/reftest-runner.d.ts
//     https://github.com/azu/reftest-runner/blob/master/src/options/default-options.js
var testEngine = new ReftestEngine({
    server: {
        port: 8989
    },
    rootDir: __dirname
});
function allPassed(resultList) {
    return resultList.every(function (result) {
        return result.passed;
    });
}

// run test with reftest.list
function reftestWithList(reftestListPath) {
    var list = testEngine.getTargetListFromFile(reftestListPath);
    return testEngine.runTests(list).then(function (resultList) {
        var formatter = testEngine.getReporter();
        var output = formatter(resultList);
        console.log(output);
        if (!allPassed(resultList)) {
            return Promise.reject(new Error("FAIL"));
        }
    });
}

var reftestListPath = path.join(__dirname, "reftest.list");
reftestWithList(reftestListPath).catch(function (error) {
    console.error(error.message);
    console.error(error.stack);
});

Programmatic usage document

Please see the docs/ :bulb:

Tests

npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT