mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
basic promise testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
836f79ec88
commit
d75dca1fc1
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-types",
|
||||
"version": "2.0.19",
|
||||
"version": "3.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
21
test.js
21
test.js
@ -103,6 +103,27 @@ var cases = test.Cases({
|
||||
RegExp: function(assert){
|
||||
},
|
||||
|
||||
Promise: function(assert){
|
||||
var p = assert(Promise.cooperative())
|
||||
|
||||
var RESOLVE = 123
|
||||
|
||||
var then
|
||||
p.then(function(v){
|
||||
console.log('then')
|
||||
then = RESOLVE })
|
||||
|
||||
var fin
|
||||
p.finally(function(){
|
||||
console.log('finally')
|
||||
fin = true })
|
||||
|
||||
p.set(123)
|
||||
|
||||
assert(then == RESOLVE, '.then(..)')
|
||||
assert(fin, '.finally(..)')
|
||||
},
|
||||
|
||||
// Date.js
|
||||
Date: function(assert){
|
||||
var d = new Date()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user