New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qunit-notifications

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qunit-notifications

Notifications for QUnit test suites

1.0.0
latest
npm
Version published
Weekly downloads
5K
-10.76%
Maintainers
2
Weekly downloads
 
Created
Source

QUnit Notifications

Build Status Code Climate

About

Adds Web Notification support to your Qunit test suite

A new Notifications checkbox will be added to the QUnit toolbar

checkbox

And after the tests complete a notification will appear with some information on the state of the test suite:

state

Notifications are off by default, and will not appear if your browser does not support Web Notifications

They are best used when you do not want to keep switching back to your browser to see the result of the test suite. Stay in your favorite development environment and keep TDDing!

Usage

QUnit.notifications();

You can pass in an options hash to customize the notification messages:

QUnit.notifications({
  timeout: 5000,
  titles: {
    passed: 'It worked!',
    failed: 'Fix your code!'
  }
});

Options

icons

URL to passed and failed images for use in the notification

Default: {}

Example:

QUnit.notifications({
  icons: {
    passed: '/assets/passed.png',
    failed: '/assets/failed.png'
  }
});
timeout

Time in miliseconds for notification to disappear

Default: 4000

Example:

QUnit.notifications({
  timeout: 5000
});
titles

Customize the notification titles

Default: {passed: 'Passed!', failed: 'Failed!'}

Example:

QUnit.notifications({
  titles: {
    passed: 'It worked!',
    failed: 'Fix your code!'
  }
});
bodies

Customize the notification bodies. Will substitue from QUnit's test suite details object.

Default: { passed: '{{passed}} of {{total}} passed', failed: '{{passed}} passed. {{failed}} failed.' }

Example:

QUnit.notifications({
  bodies: {
    passed: '{{passed}} of {{total}} passed in {{runtime}}ms',
    failed: '{{failed}} of {{total}} failed in {{runtime}}ms'
  }
});

Authors

We are very thankful for the many contributors

Versioning

This library follows Semantic Versioning

Want to help?

Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.

DockYard, Inc © 2014

@dockyard

Licensed under the MIT license

FAQs

Package last updated on 25 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts