Socket
Socket
Sign inDemoInstall

jasmine-pit

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-pit

Writing tests for promises in jasmine is kind of a pain in the ass. jasmine-pit makes doing such things a tiny bit easier by providing an augmented version of `it()` (called `pit()`) that allows you to simply return a promise that may eventually assert ex


Version published
Maintainers
1
Created
Source

jasmine-pit

Writing tests for promises in jasmine is kind of a pain in the ass. jasmine-pit makes doing such things a tiny bit easier by providing an augmented version of it() (called pit()) that allows you to simply return a promise that may eventually assert expect()s (or propogate errors).

Example


jasminePit.install(window);

describe('MyTestSuite', functtion() {
  pit('Spec 1', function() {
    return funcThatReturnsPromise().then(function(stuff) {
      expect(stuff).toBe(stuff_i_expect_it_to_be);
    });
  });
});

This will execute the promise chain and, if any errors occur along the way, they will be propogated up to jasmine and reported as normal.

Don't be afraid to take a look at the source. The definition for pit() is stupid simple.

Keywords

FAQs

Package last updated on 01 Mar 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc