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

async-box

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-box - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

build.js

10

package.json
{
"name": "async-box",
"version": "0.2.0",
"version": "0.3.0",
"description": "Your main application object with promise async api API",

@@ -12,5 +12,6 @@ "author": {

},
"main": "index.js",
"main": "lib/main.js",
"scripts": {
"test": "node spec/node-runner"
"test": "node spec/node-runner",
"browser-build": "node build.js"
},

@@ -30,5 +31,6 @@ "keywords": [

"jasmine-spec-reporter": "^2.4.0",
"jasmine-expect ": "latest"
"jasmine-expect ": "latest",
"webpack": "^1.12.2"
},
"license": "MIT"
}

40

spec/async-box-spec.js
describe("async-box", function() {
var AsyncBox = require('../index');
var Promise = require('bluebird');
var EventEmitter = require('wolfy87-eventemitter');

@@ -145,3 +142,3 @@ var app;

it('should resolve a promise with responses array', function() {
it('should resolve a promise with responses array', function(done) {
app.respondAsync('request-type-1', function(arg) {

@@ -178,39 +175,6 @@ return new Promise.delay(42).then(function() {

expect(responses).toContain('request-arg-6');
});
});
it('should spread results if spread option is passed', function() {
app.respondAsync('request-type-1', function(arg) {
return new Promise.delay(42).then(function() {
return arg;
});
done()
});
app.respondAsync('request-type-2', function(arg) {
return new Promise.delay(33).then(function() {
return 'request-arg-' + arg;
});
});
app.requestAllAsync([
['request-type-1', 'request-arg-1'],
['request-type-1', 'request-arg-2'],
['request-type-1', 'request-arg-3'],
['request-type-2', 4],
['request-type-2', 5],
['request-type-2', 6],
], {
spread: true
}).then(function(r1, r2, r3, r4, r5, r6) {
expect(r1).toBe('request-arg-1');
expect(r2).toBe('request-arg-2');
expect(r3).toBe('request-arg-3');
expect(r3).toBe('request-arg-4');
expect(r4).toBe('request-arg-5');
expect(r5).toBe('request-arg-6');
});
});

@@ -217,0 +181,0 @@

@@ -19,7 +19,12 @@ var Jasmine = require('jasmine');

jasmine.getEnv().addReporter(reporter);
runner.loadConfigFile();
runner.loadConfig({
spec_dir: "spec",
spec_files: [
"**/*[sS]pec.js"
],
helpers: [
"helpers/**/*.js"
]
});
require('jasmine-expect');
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100;
runner.execute();
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