basic promise testing...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-03 16:58:59 +03:00
parent 836f79ec88
commit d75dca1fc1
2 changed files with 22 additions and 1 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "2.0.19",
"version": "3.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

21
test.js
View File

@ -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()