mol_dump_lib 0.0.516 → 0.0.518

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 CHANGED
@@ -8060,6 +8060,68 @@ var $;
8060
8060
  });
8061
8061
  })($ || ($ = {}));
8062
8062
 
8063
+ ;
8064
+ "use strict";
8065
+ var $;
8066
+ (function ($) {
8067
+ class $mol_after_work extends $mol_object2 {
8068
+ delay;
8069
+ task;
8070
+ id;
8071
+ constructor(delay, task) {
8072
+ super();
8073
+ this.delay = delay;
8074
+ this.task = task;
8075
+ this.id = requestIdleCallback(task, { timeout: delay });
8076
+ }
8077
+ destructor() {
8078
+ cancelIdleCallback(this.id);
8079
+ }
8080
+ }
8081
+ $.$mol_after_work = $mol_after_work;
8082
+ if (typeof requestIdleCallback !== 'function') {
8083
+ $.$mol_after_work = $mol_after_timeout;
8084
+ }
8085
+ })($ || ($ = {}));
8086
+
8087
+ ;
8088
+ "use strict";
8089
+ var $;
8090
+ (function ($_1) {
8091
+ $mol_test_mocks.push($ => {
8092
+ $.$mol_after_work = $mol_after_mock_timeout;
8093
+ });
8094
+ })($ || ($ = {}));
8095
+
8096
+ ;
8097
+ "use strict";
8098
+ var $;
8099
+ (function ($) {
8100
+ function $mol_wait_rest_async() {
8101
+ return new Promise(done => {
8102
+ new this.$mol_after_work(16, () => done(null));
8103
+ });
8104
+ }
8105
+ $.$mol_wait_rest_async = $mol_wait_rest_async;
8106
+ function $mol_wait_rest() {
8107
+ return this.$mol_wire_sync(this).$mol_wait_rest_async();
8108
+ }
8109
+ $.$mol_wait_rest = $mol_wait_rest;
8110
+ })($ || ($ = {}));
8111
+
8112
+ ;
8113
+ "use strict";
8114
+ var $;
8115
+ (function ($_1) {
8116
+ var $$;
8117
+ (function ($$) {
8118
+ $mol_test_mocks.push($ => {
8119
+ $.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
8120
+ $.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
8121
+ });
8122
+ })($$ = $_1.$$ || ($_1.$$ = {}));
8123
+ })($ || ($ = {}));
8124
+
8063
8125
  ;
8064
8126
  "use strict";
8065
8127
  var $;
@@ -8078,6 +8140,19 @@ var $;
8078
8140
  $.$mol_wait_timeout = $mol_wait_timeout;
8079
8141
  })($ || ($ = {}));
8080
8142
 
8143
+ ;
8144
+ "use strict";
8145
+ var $;
8146
+ (function ($_1) {
8147
+ var $$;
8148
+ (function ($$) {
8149
+ $mol_test_mocks.push($ => {
8150
+ $.$mol_wait_rest = function $mol_wait_rest_mock() { };
8151
+ $.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
8152
+ });
8153
+ })($$ = $_1.$$ || ($_1.$$ = {}));
8154
+ })($ || ($ = {}));
8155
+
8081
8156
  ;
8082
8157
  "use strict";
8083
8158
  var $;
@@ -8100,7 +8175,7 @@ var $;
8100
8175
  static last = [];
8101
8176
  static send(next) {
8102
8177
  $mol_wire_sync(this.first).push(next);
8103
- this.$.$mol_wait_timeout(0);
8178
+ $$.$mol_wait_timeout(0);
8104
8179
  this.last.push(next);
8105
8180
  }
8106
8181
  }
@@ -8109,15 +8184,15 @@ var $;
8109
8184
  const promise = name('jin');
8110
8185
  $.$mol_after_mock_warp();
8111
8186
  await promise;
8112
- $mol_assert_like(NameLogger.first, ['john', 'jin']);
8113
- $mol_assert_like(NameLogger.last, ['jin']);
8187
+ $mol_assert_equal(NameLogger.first, ['john', 'jin']);
8188
+ $mol_assert_equal(NameLogger.last, ['jin']);
8114
8189
  },
8115
8190
  async 'Latest function calls wins'($) {
8116
8191
  const first = [];
8117
8192
  const last = [];
8118
8193
  function send_name(next) {
8119
8194
  $mol_wire_sync(first).push(next);
8120
- $.$mol_wait_timeout(0);
8195
+ $$.$mol_wait_timeout(0);
8121
8196
  last.push(next);
8122
8197
  }
8123
8198
  const name = $mol_wire_async(send_name);
@@ -8125,8 +8200,8 @@ var $;
8125
8200
  const promise = name('jin');
8126
8201
  $.$mol_after_mock_warp();
8127
8202
  await promise;
8128
- $mol_assert_like(first, ['john', 'jin']);
8129
- $mol_assert_like(last, ['jin']);
8203
+ $mol_assert_equal(first, ['john', 'jin']);
8204
+ $mol_assert_equal(last, ['jin']);
8130
8205
  },
8131
8206
  });
8132
8207
  })($ || ($ = {}));