Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-spy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-spy

Asynchronous function spying for tests.

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source
var join = require('async-spy').join;

it('test must trigger multiple callbacks', function (done) {
    var j = join(done);
    asyncCall(j.expectCall()); // creates a source callback
    syncCall(j.expectCall());  // creates a source callback

    asyncCall(j.expectCall(function(arg) {
        assert(arg);
    }));  // creates a source callback that also calls callback within

    // `done` will not be called until both asyncCall and syncCall
    // complete, triggering their callbacks
});

it('another test using alias', function (done) {
    var j = join(done);

    asyncCall(j()); // j() is alias for j.expectCall()
});

Keywords

FAQs

Package last updated on 28 Aug 2013

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