JSPM

qunit-assert-step

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3820
  • Score
    100M100P100Q137162F
  • License MIT

A QUnit plugin for asserting the proper sequence in which the code should execute.

Package Exports

  • qunit-assert-step

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (qunit-assert-step) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status NPM version

QUnit Step assertion plugin

This plugin for QUnit adds a step assertion method to test the proper sequence in which the code should execute.

Usage

assert.step(expected, message);

Where:

  • expected: The expected step number (assertion sequence index)
  • message: Optional message, same as for other assertions

Examples

QUnit.test("example test", function(assert) {
  function x() {
    assert.step(2, "function y should be called first");
  }
  function y() {
    assert.step(1);
  }
  y();
  x();
});

For more examples, refer to the unit tests.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.