mol_wire_lib 1.0.185 → 1.0.188
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.deps.json +1 -1
- package/node.esm.js +4 -2
- package/node.esm.js.map +1 -1
- package/node.js +4 -2
- package/node.js.map +1 -1
- package/node.test.js +47 -38
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.esm.js +4 -2
- package/web.esm.js.map +1 -1
- package/web.js +4 -2
- package/web.js.map +1 -1
- package/web.test.js +52 -45
- package/web.test.js.map +1 -1
package/web.test.js
CHANGED
|
@@ -750,51 +750,6 @@ var $;
|
|
|
750
750
|
;
|
|
751
751
|
"use strict";
|
|
752
752
|
var $;
|
|
753
|
-
(function ($_1) {
|
|
754
|
-
$mol_test_mocks.push($ => {
|
|
755
|
-
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
756
|
-
});
|
|
757
|
-
})($ || ($ = {}));
|
|
758
|
-
//mol/after/timeout/timeout.test.ts
|
|
759
|
-
;
|
|
760
|
-
"use strict";
|
|
761
|
-
var $;
|
|
762
|
-
(function ($_1) {
|
|
763
|
-
$mol_test({
|
|
764
|
-
async 'Latest Calls Wins on Concurrency'($) {
|
|
765
|
-
class NameLogger extends $mol_object2 {
|
|
766
|
-
static $ = $;
|
|
767
|
-
static first = [];
|
|
768
|
-
static last = [];
|
|
769
|
-
static send(next) {
|
|
770
|
-
$mol_wire_sync(this.first).push(next);
|
|
771
|
-
this.$.$mol_wait_timeout(0);
|
|
772
|
-
this.last.push(next);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
const name = $mol_wire_async(NameLogger).send;
|
|
776
|
-
name('john');
|
|
777
|
-
const promise = name('jin');
|
|
778
|
-
$.$mol_after_mock_warp();
|
|
779
|
-
await promise;
|
|
780
|
-
$mol_assert_like(NameLogger.first, ['john', 'jin']);
|
|
781
|
-
$mol_assert_like(NameLogger.last, ['jin']);
|
|
782
|
-
},
|
|
783
|
-
async 'Wrap function'($) {
|
|
784
|
-
const name = $mol_wire_async(function (name) {
|
|
785
|
-
$.$mol_wait_timeout(0);
|
|
786
|
-
return name;
|
|
787
|
-
});
|
|
788
|
-
const promise = name('jin');
|
|
789
|
-
$.$mol_after_mock_warp();
|
|
790
|
-
$mol_assert_like(await promise, 'jin');
|
|
791
|
-
},
|
|
792
|
-
});
|
|
793
|
-
})($ || ($ = {}));
|
|
794
|
-
//mol/wire/async/async.test.ts
|
|
795
|
-
;
|
|
796
|
-
"use strict";
|
|
797
|
-
var $;
|
|
798
753
|
(function ($_1) {
|
|
799
754
|
$mol_test_mocks.push($ => {
|
|
800
755
|
$.$mol_after_frame = $mol_after_mock_commmon;
|
|
@@ -886,6 +841,58 @@ var $;
|
|
|
886
841
|
;
|
|
887
842
|
"use strict";
|
|
888
843
|
var $;
|
|
844
|
+
(function ($_1) {
|
|
845
|
+
$mol_test_mocks.push($ => {
|
|
846
|
+
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
847
|
+
});
|
|
848
|
+
})($ || ($ = {}));
|
|
849
|
+
//mol/after/timeout/timeout.test.ts
|
|
850
|
+
;
|
|
851
|
+
"use strict";
|
|
852
|
+
var $;
|
|
853
|
+
(function ($_1) {
|
|
854
|
+
$mol_test({
|
|
855
|
+
async 'Latest method calls wins'($) {
|
|
856
|
+
class NameLogger extends $mol_object2 {
|
|
857
|
+
static $ = $;
|
|
858
|
+
static first = [];
|
|
859
|
+
static last = [];
|
|
860
|
+
static send(next) {
|
|
861
|
+
$mol_wire_sync(this.first).push(next);
|
|
862
|
+
this.$.$mol_wait_timeout(0);
|
|
863
|
+
this.last.push(next);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
const name = $mol_wire_async(NameLogger).send;
|
|
867
|
+
name('john');
|
|
868
|
+
const promise = name('jin');
|
|
869
|
+
$.$mol_after_mock_warp();
|
|
870
|
+
await promise;
|
|
871
|
+
$mol_assert_like(NameLogger.first, ['john', 'jin']);
|
|
872
|
+
$mol_assert_like(NameLogger.last, ['jin']);
|
|
873
|
+
},
|
|
874
|
+
async 'Latest function calls wins'($) {
|
|
875
|
+
const first = [];
|
|
876
|
+
const last = [];
|
|
877
|
+
function send_name(next) {
|
|
878
|
+
$mol_wire_sync(first).push(next);
|
|
879
|
+
$.$mol_wait_timeout(0);
|
|
880
|
+
last.push(next);
|
|
881
|
+
}
|
|
882
|
+
const name = $mol_wire_async(send_name);
|
|
883
|
+
name('john');
|
|
884
|
+
const promise = name('jin');
|
|
885
|
+
$.$mol_after_mock_warp();
|
|
886
|
+
await promise;
|
|
887
|
+
$mol_assert_like(first, ['john', 'jin']);
|
|
888
|
+
$mol_assert_like(last, ['jin']);
|
|
889
|
+
},
|
|
890
|
+
});
|
|
891
|
+
})($ || ($ = {}));
|
|
892
|
+
//mol/wire/async/async.test.ts
|
|
893
|
+
;
|
|
894
|
+
"use strict";
|
|
895
|
+
var $;
|
|
889
896
|
(function ($_1) {
|
|
890
897
|
$mol_test({
|
|
891
898
|
'Cached channel'($) {
|