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

qunit-events

v0.0.5

Published

Event-driven feedback from the QUnit test runner

Downloads

12

Readme

QUnit Events Build Status

A pluggable, event-driven extension to QUnit

Why might you want to use this?

Anytime you want QUnit to communicate test results and status outside of the test runner’s frame. This might include:

  • Showing test results along side your application as you develop
  • Communicating test results to an instructor’s machine in a classroom setting
  • Agglomerating paralleled tests into a single status UI

How does this work

There are two worlds we need to worry about:

  • Test World where qunit runs all of your tests
  • App World where we want to see the results of your tests

This library embeds a tiny hidden test world in your app world, by running your qunit tests in an iframe. While in the app world, you will get notifications of what's happening in the test world by way of events.

This library is comprised of two halves

  • index.js Adds some features to QUnit, allowing it to emit events that may be consumed through postMessage or other mechanisms
  • client.js Makes it easy to listen the test world's events, from within the app world.

Setting it up

  • Make sure index.js is included wherever you have QUnit present
  • Make sure client.js is included wherever you wish to receive test events (and create the iframe for test-running)
  • Create and initialize a QUnitEventsClient in your application
In the App World
var client = new QUnitEventsClient({
  testUrl: 'http://localhost:4200/tests' // test-runner URL
});

client.registerChangeListener(function(testState) {
  // This function will be invoked whenever test state changes
  //   (i.e., a test passes or fails)
});

// We'll choose a DOM element inside which to place the test-runner frame
var $elem = $('.parent-to-create-iframe-in');

// Now, we'll create the iframe. Once it's set up, events will start firing
client.setupTestFrame($elem);

Support for additional features is in the works, including WebRTC and WebSocket support for classroom use.