jasmine-async-suite

0.0.8 • Public • Published

jasmine-async-suite

Adds async function to jasmine suite function that expect promises for asynchronous tests.

To install:

var jasmineAsync = require('jasmine-async-suite');
jasmineAsync.install();

Uninstalling:

afterAll(function() {
  var jasmineAsync = require('jasmine-async-suite');
  jasmineAsync.uninstall();
});

For example the following async test:

  function timeout() {
    return new Promise(function(resolve) {
      setTimeout(resolve, 1000);
    });
  }
 
  it('passes when enough time has passed', function(done) {
    timeout().then(done);
  });    

Becomes:

  it.async('passes when enough time has passed', function() {
    return timeout();  
  });    

It works and looks even better with the proposed ES7 async/await syntax

  it.async('passes when enough time has passed', async function() {
    await timeout();  
  });    

(c) Copyright 2016 Ryan Dy. All Rights Reserved.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.88latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.88
0.0.76
0.0.60
0.0.51
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i jasmine-async-suite

Weekly Downloads

15

Version

0.0.8

License

MIT

Last publish

Collaborators

  • rdy