Comparing version 0.2.0 to 0.3.0
{ | ||
"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" | ||
} |
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(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
263704
20
4781
4
1