New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

crash-course

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crash-course

The simplest testing framework, ever. Browser friendly, too.

latest
Source
npmnpm
Version
1.3.1
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

crash-course

The simplest testing framework, ever. Browser friendly, too.

Install

Node:

npm install --save crash-course

Bower:

bower install crash-course --save

Bower continued (or just download the script and save it somewhere):

<script src="/path-to-the-script/crash.js"></script>

require.js compatible, too.

Usage

Node:

'use strict';

var crash_course = require('crash-course');
var someTest = crash_course('someTest');

someTest.case(function(t) {
  // do things...
  if (passed) {
    t.pass('yay!');
  } else {
    t.fail('oh noes.');
  }
});

Browser:

'use strict';
// assumes you've already included crash.js
var someTest = crash_course('someTest');
someTest.case(function(t) {
  // stuff
  if (passed) {
    t.pass('yippee!');
  } else {
    t.fail('ummmmm. well, then.');
  }
});

API

Requiring the module returns a function:

crash_course(description[, fancy])

Returns a test with the provided description, and if provided, fancy describes whether it should output with colors. Note: fancy has no effect in browsers, since you can't output color to the console in the browser.

test.case(testFunction)

The testFunction receives 1 argument: a new Case.

test.freeform()

Returns a new Case. Useful when testing things that require a regular this context.

Case

The Case class has 3 methods:

pass, fail, and warn

Each function outputs the corresponding status for the test case and accepts an optional description. However, if you call more than one or call one more than once, the function will throw (you can't call pass and then fail, or call pass twice).

Keywords

test

FAQs

Package last updated on 29 Jun 2016

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