mol_data_all 1.1.1278 → 1.1.1279
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
|
@@ -2030,7 +2030,7 @@ var $;
|
|
|
2030
2030
|
static last = [];
|
|
2031
2031
|
static send(next) {
|
|
2032
2032
|
$mol_wire_sync(this.first).push(next);
|
|
2033
|
-
|
|
2033
|
+
$$.$mol_wait_timeout(0);
|
|
2034
2034
|
this.last.push(next);
|
|
2035
2035
|
}
|
|
2036
2036
|
}
|
|
@@ -2039,15 +2039,15 @@ var $;
|
|
|
2039
2039
|
const promise = name('jin');
|
|
2040
2040
|
$.$mol_after_mock_warp();
|
|
2041
2041
|
await promise;
|
|
2042
|
-
$
|
|
2043
|
-
$
|
|
2042
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
2043
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
2044
2044
|
},
|
|
2045
2045
|
async 'Latest function calls wins'($) {
|
|
2046
2046
|
const first = [];
|
|
2047
2047
|
const last = [];
|
|
2048
2048
|
function send_name(next) {
|
|
2049
2049
|
$mol_wire_sync(first).push(next);
|
|
2050
|
-
|
|
2050
|
+
$$.$mol_wait_timeout(0);
|
|
2051
2051
|
last.push(next);
|
|
2052
2052
|
}
|
|
2053
2053
|
const name = $mol_wire_async(send_name);
|
|
@@ -2055,8 +2055,8 @@ var $;
|
|
|
2055
2055
|
const promise = name('jin');
|
|
2056
2056
|
$.$mol_after_mock_warp();
|
|
2057
2057
|
await promise;
|
|
2058
|
-
$
|
|
2059
|
-
$
|
|
2058
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
2059
|
+
$mol_assert_equal(last, ['jin']);
|
|
2060
2060
|
},
|
|
2061
2061
|
});
|
|
2062
2062
|
})($ || ($ = {}));
|
|
@@ -2201,6 +2201,68 @@ var $;
|
|
|
2201
2201
|
});
|
|
2202
2202
|
})($ || ($ = {}));
|
|
2203
2203
|
|
|
2204
|
+
;
|
|
2205
|
+
"use strict";
|
|
2206
|
+
var $;
|
|
2207
|
+
(function ($) {
|
|
2208
|
+
class $mol_after_work extends $mol_object2 {
|
|
2209
|
+
delay;
|
|
2210
|
+
task;
|
|
2211
|
+
id;
|
|
2212
|
+
constructor(delay, task) {
|
|
2213
|
+
super();
|
|
2214
|
+
this.delay = delay;
|
|
2215
|
+
this.task = task;
|
|
2216
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
2217
|
+
}
|
|
2218
|
+
destructor() {
|
|
2219
|
+
cancelIdleCallback(this.id);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
$.$mol_after_work = $mol_after_work;
|
|
2223
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
2224
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
2225
|
+
}
|
|
2226
|
+
})($ || ($ = {}));
|
|
2227
|
+
|
|
2228
|
+
;
|
|
2229
|
+
"use strict";
|
|
2230
|
+
var $;
|
|
2231
|
+
(function ($_1) {
|
|
2232
|
+
$mol_test_mocks.push($ => {
|
|
2233
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
2234
|
+
});
|
|
2235
|
+
})($ || ($ = {}));
|
|
2236
|
+
|
|
2237
|
+
;
|
|
2238
|
+
"use strict";
|
|
2239
|
+
var $;
|
|
2240
|
+
(function ($) {
|
|
2241
|
+
function $mol_wait_rest_async() {
|
|
2242
|
+
return new Promise(done => {
|
|
2243
|
+
new this.$mol_after_work(16, () => done(null));
|
|
2244
|
+
});
|
|
2245
|
+
}
|
|
2246
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
2247
|
+
function $mol_wait_rest() {
|
|
2248
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
2249
|
+
}
|
|
2250
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
2251
|
+
})($ || ($ = {}));
|
|
2252
|
+
|
|
2253
|
+
;
|
|
2254
|
+
"use strict";
|
|
2255
|
+
var $;
|
|
2256
|
+
(function ($_1) {
|
|
2257
|
+
var $$;
|
|
2258
|
+
(function ($$) {
|
|
2259
|
+
$mol_test_mocks.push($ => {
|
|
2260
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
2261
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
2262
|
+
});
|
|
2263
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2264
|
+
})($ || ($ = {}));
|
|
2265
|
+
|
|
2204
2266
|
;
|
|
2205
2267
|
"use strict";
|
|
2206
2268
|
var $;
|
|
@@ -2219,6 +2281,19 @@ var $;
|
|
|
2219
2281
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
2220
2282
|
})($ || ($ = {}));
|
|
2221
2283
|
|
|
2284
|
+
;
|
|
2285
|
+
"use strict";
|
|
2286
|
+
var $;
|
|
2287
|
+
(function ($_1) {
|
|
2288
|
+
var $$;
|
|
2289
|
+
(function ($$) {
|
|
2290
|
+
$mol_test_mocks.push($ => {
|
|
2291
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
2292
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
2293
|
+
});
|
|
2294
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2295
|
+
})($ || ($ = {}));
|
|
2296
|
+
|
|
2222
2297
|
;
|
|
2223
2298
|
"use strict";
|
|
2224
2299
|
var $;
|