0.0.8 • Published 7 years ago

jasmine-async-suite v0.0.8

Weekly downloads
51
License
MIT
Repository
github
Last release
7 years ago

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.

0.0.8

7 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago