-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
32 lines (27 loc) · 846 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*!
* native-promise <https://github.com/tunnckoCore/native-promise>
*
* Copyright (c) 2015 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
* Released under the MIT license.
*/
/* jshint asi:true */
'use strict'
var test = require('mukla')
var semver = require('semver')
var isPromise = require('is-promise')
var NativePromise = require('./index')
test('should be native Promise on node >= v0.11.13', function (done) {
if (!semver.lt(process.version, '0.11.13')) {
test.ok(NativePromise)
var promise = NativePromise.resolve(123)
test.strictEqual(isPromise(promise), true)
}
done()
})
test('should be `false` if dont have support, node < v0.11.13', function (done) {
/* istanbul ignore next */
if (semver.lt(process.version, '0.11.13')) {
test.strictEqual(NativePromise, false)
}
done()
})