mol_compare_deep 0.0.1067 → 0.0.1069
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
|
@@ -2481,7 +2481,7 @@ var $;
|
|
|
2481
2481
|
static last = [];
|
|
2482
2482
|
static send(next) {
|
|
2483
2483
|
$mol_wire_sync(this.first).push(next);
|
|
2484
|
-
|
|
2484
|
+
$$.$mol_wait_timeout(0);
|
|
2485
2485
|
this.last.push(next);
|
|
2486
2486
|
}
|
|
2487
2487
|
}
|
|
@@ -2490,15 +2490,15 @@ var $;
|
|
|
2490
2490
|
const promise = name('jin');
|
|
2491
2491
|
$.$mol_after_mock_warp();
|
|
2492
2492
|
await promise;
|
|
2493
|
-
$
|
|
2494
|
-
$
|
|
2493
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
2494
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
2495
2495
|
},
|
|
2496
2496
|
async 'Latest function calls wins'($) {
|
|
2497
2497
|
const first = [];
|
|
2498
2498
|
const last = [];
|
|
2499
2499
|
function send_name(next) {
|
|
2500
2500
|
$mol_wire_sync(first).push(next);
|
|
2501
|
-
|
|
2501
|
+
$$.$mol_wait_timeout(0);
|
|
2502
2502
|
last.push(next);
|
|
2503
2503
|
}
|
|
2504
2504
|
const name = $mol_wire_async(send_name);
|
|
@@ -2506,8 +2506,8 @@ var $;
|
|
|
2506
2506
|
const promise = name('jin');
|
|
2507
2507
|
$.$mol_after_mock_warp();
|
|
2508
2508
|
await promise;
|
|
2509
|
-
$
|
|
2510
|
-
$
|
|
2509
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
2510
|
+
$mol_assert_equal(last, ['jin']);
|
|
2511
2511
|
},
|
|
2512
2512
|
});
|
|
2513
2513
|
})($ || ($ = {}));
|
|
@@ -2678,6 +2678,68 @@ var $;
|
|
|
2678
2678
|
});
|
|
2679
2679
|
})($ || ($ = {}));
|
|
2680
2680
|
|
|
2681
|
+
;
|
|
2682
|
+
"use strict";
|
|
2683
|
+
var $;
|
|
2684
|
+
(function ($) {
|
|
2685
|
+
class $mol_after_work extends $mol_object2 {
|
|
2686
|
+
delay;
|
|
2687
|
+
task;
|
|
2688
|
+
id;
|
|
2689
|
+
constructor(delay, task) {
|
|
2690
|
+
super();
|
|
2691
|
+
this.delay = delay;
|
|
2692
|
+
this.task = task;
|
|
2693
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
2694
|
+
}
|
|
2695
|
+
destructor() {
|
|
2696
|
+
cancelIdleCallback(this.id);
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
$.$mol_after_work = $mol_after_work;
|
|
2700
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
2701
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
2702
|
+
}
|
|
2703
|
+
})($ || ($ = {}));
|
|
2704
|
+
|
|
2705
|
+
;
|
|
2706
|
+
"use strict";
|
|
2707
|
+
var $;
|
|
2708
|
+
(function ($_1) {
|
|
2709
|
+
$mol_test_mocks.push($ => {
|
|
2710
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
2711
|
+
});
|
|
2712
|
+
})($ || ($ = {}));
|
|
2713
|
+
|
|
2714
|
+
;
|
|
2715
|
+
"use strict";
|
|
2716
|
+
var $;
|
|
2717
|
+
(function ($) {
|
|
2718
|
+
function $mol_wait_rest_async() {
|
|
2719
|
+
return new Promise(done => {
|
|
2720
|
+
new this.$mol_after_work(16, () => done(null));
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
2724
|
+
function $mol_wait_rest() {
|
|
2725
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
2726
|
+
}
|
|
2727
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
2728
|
+
})($ || ($ = {}));
|
|
2729
|
+
|
|
2730
|
+
;
|
|
2731
|
+
"use strict";
|
|
2732
|
+
var $;
|
|
2733
|
+
(function ($_1) {
|
|
2734
|
+
var $$;
|
|
2735
|
+
(function ($$) {
|
|
2736
|
+
$mol_test_mocks.push($ => {
|
|
2737
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
2738
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
2739
|
+
});
|
|
2740
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2741
|
+
})($ || ($ = {}));
|
|
2742
|
+
|
|
2681
2743
|
;
|
|
2682
2744
|
"use strict";
|
|
2683
2745
|
var $;
|
|
@@ -2696,6 +2758,19 @@ var $;
|
|
|
2696
2758
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
2697
2759
|
})($ || ($ = {}));
|
|
2698
2760
|
|
|
2761
|
+
;
|
|
2762
|
+
"use strict";
|
|
2763
|
+
var $;
|
|
2764
|
+
(function ($_1) {
|
|
2765
|
+
var $$;
|
|
2766
|
+
(function ($$) {
|
|
2767
|
+
$mol_test_mocks.push($ => {
|
|
2768
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
2769
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
2770
|
+
});
|
|
2771
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2772
|
+
})($ || ($ = {}));
|
|
2773
|
+
|
|
2699
2774
|
;
|
|
2700
2775
|
"use strict";
|
|
2701
2776
|
var $;
|