diff options
author | Aydar Zartdinov <zartdinov@gmail.com> | 2015-07-09 15:44:30 +0300 |
---|---|---|
committer | Aydar Zartdinov <zartdinov@gmail.com> | 2015-07-09 15:44:30 +0300 |
commit | 173e9133c064aaa22a699ba038754c5994783733 (patch) | |
tree | 1d317e6d18bc2ce08bfeddf790748cc62a8ceaa2 | |
parent | 458c73cbd16100a28d60e8fefc9cd15447b19725 (diff) | |
download | async-173e9133c064aaa22a699ba038754c5994783733.tar.gz |
unit test for NPO
-rw-r--r-- | package.json | 1 | ||||
-rwxr-xr-x | test/test-async.js | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/package.json b/package.json index fa0b1ec..e2707b9 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "jshint": "~2.8.0", "lodash": "^3.9.0", "mkdirp": "~0.5.1", + "native-promise-only": "^0.8.0-a", "nodeunit": ">0.0.0", "nyc": "^2.1.0", "rsvp": "^3.0.18", diff --git a/test/test-async.js b/test/test-async.js index 3e237c6..844bce9 100755 --- a/test/test-async.js +++ b/test/test-async.js @@ -4269,8 +4269,16 @@ exports['asyncify'] = { } }, - 'promisified': ['bluebird', 'es6-promise', 'rsvp'].reduce(function(promises, name) { - var Promise = require(name).Promise; + 'promisified': [ + 'native-promise-only', + 'bluebird', + 'es6-promise', + 'rsvp' + ].reduce(function(promises, name) { + var Promise = require(name); + if (typeof Promise.Promise === 'function') { + Promise = Promise.Promise; + } promises[name] = { 'resolve': function(test) { var promisified = function(argument) { |