mol_key 0.0.1051 → 0.0.1052
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node.test.js +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -2403,7 +2403,7 @@ var $;
|
|
|
2403
2403
|
static last = [];
|
|
2404
2404
|
static send(next) {
|
|
2405
2405
|
$mol_wire_sync(this.first).push(next);
|
|
2406
|
-
|
|
2406
|
+
$$.$mol_wait_timeout(0);
|
|
2407
2407
|
this.last.push(next);
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
@@ -2412,15 +2412,15 @@ var $;
|
|
|
2412
2412
|
const promise = name('jin');
|
|
2413
2413
|
$.$mol_after_mock_warp();
|
|
2414
2414
|
await promise;
|
|
2415
|
-
$
|
|
2416
|
-
$
|
|
2415
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
2416
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
2417
2417
|
},
|
|
2418
2418
|
async 'Latest function calls wins'($) {
|
|
2419
2419
|
const first = [];
|
|
2420
2420
|
const last = [];
|
|
2421
2421
|
function send_name(next) {
|
|
2422
2422
|
$mol_wire_sync(first).push(next);
|
|
2423
|
-
|
|
2423
|
+
$$.$mol_wait_timeout(0);
|
|
2424
2424
|
last.push(next);
|
|
2425
2425
|
}
|
|
2426
2426
|
const name = $mol_wire_async(send_name);
|
|
@@ -2428,8 +2428,8 @@ var $;
|
|
|
2428
2428
|
const promise = name('jin');
|
|
2429
2429
|
$.$mol_after_mock_warp();
|
|
2430
2430
|
await promise;
|
|
2431
|
-
$
|
|
2432
|
-
$
|
|
2431
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
2432
|
+
$mol_assert_equal(last, ['jin']);
|
|
2433
2433
|
},
|
|
2434
2434
|
});
|
|
2435
2435
|
})($ || ($ = {}));
|
|
@@ -2600,6 +2600,68 @@ var $;
|
|
|
2600
2600
|
});
|
|
2601
2601
|
})($ || ($ = {}));
|
|
2602
2602
|
|
|
2603
|
+
;
|
|
2604
|
+
"use strict";
|
|
2605
|
+
var $;
|
|
2606
|
+
(function ($) {
|
|
2607
|
+
class $mol_after_work extends $mol_object2 {
|
|
2608
|
+
delay;
|
|
2609
|
+
task;
|
|
2610
|
+
id;
|
|
2611
|
+
constructor(delay, task) {
|
|
2612
|
+
super();
|
|
2613
|
+
this.delay = delay;
|
|
2614
|
+
this.task = task;
|
|
2615
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
2616
|
+
}
|
|
2617
|
+
destructor() {
|
|
2618
|
+
cancelIdleCallback(this.id);
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
$.$mol_after_work = $mol_after_work;
|
|
2622
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
2623
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
2624
|
+
}
|
|
2625
|
+
})($ || ($ = {}));
|
|
2626
|
+
|
|
2627
|
+
;
|
|
2628
|
+
"use strict";
|
|
2629
|
+
var $;
|
|
2630
|
+
(function ($_1) {
|
|
2631
|
+
$mol_test_mocks.push($ => {
|
|
2632
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
2633
|
+
});
|
|
2634
|
+
})($ || ($ = {}));
|
|
2635
|
+
|
|
2636
|
+
;
|
|
2637
|
+
"use strict";
|
|
2638
|
+
var $;
|
|
2639
|
+
(function ($) {
|
|
2640
|
+
function $mol_wait_rest_async() {
|
|
2641
|
+
return new Promise(done => {
|
|
2642
|
+
new this.$mol_after_work(16, () => done(null));
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
2646
|
+
function $mol_wait_rest() {
|
|
2647
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
2648
|
+
}
|
|
2649
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
2650
|
+
})($ || ($ = {}));
|
|
2651
|
+
|
|
2652
|
+
;
|
|
2653
|
+
"use strict";
|
|
2654
|
+
var $;
|
|
2655
|
+
(function ($_1) {
|
|
2656
|
+
var $$;
|
|
2657
|
+
(function ($$) {
|
|
2658
|
+
$mol_test_mocks.push($ => {
|
|
2659
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
2660
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
2661
|
+
});
|
|
2662
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2663
|
+
})($ || ($ = {}));
|
|
2664
|
+
|
|
2603
2665
|
;
|
|
2604
2666
|
"use strict";
|
|
2605
2667
|
var $;
|
|
@@ -2618,6 +2680,19 @@ var $;
|
|
|
2618
2680
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
2619
2681
|
})($ || ($ = {}));
|
|
2620
2682
|
|
|
2683
|
+
;
|
|
2684
|
+
"use strict";
|
|
2685
|
+
var $;
|
|
2686
|
+
(function ($_1) {
|
|
2687
|
+
var $$;
|
|
2688
|
+
(function ($$) {
|
|
2689
|
+
$mol_test_mocks.push($ => {
|
|
2690
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
2691
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
2692
|
+
});
|
|
2693
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2694
|
+
})($ || ($ = {}));
|
|
2695
|
+
|
|
2621
2696
|
;
|
|
2622
2697
|
"use strict";
|
|
2623
2698
|
var $;
|