mol_tree2 1.0.253 → 1.0.255
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 +11 -1
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +11 -1
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -1319,6 +1319,16 @@ var $;
|
|
|
1319
1319
|
;
|
|
1320
1320
|
"use strict";
|
|
1321
1321
|
var $;
|
|
1322
|
+
(function ($) {
|
|
1323
|
+
function $mol_promise_like(val) {
|
|
1324
|
+
return val && typeof val.then === 'function';
|
|
1325
|
+
}
|
|
1326
|
+
$.$mol_promise_like = $mol_promise_like;
|
|
1327
|
+
})($ || ($ = {}));
|
|
1328
|
+
//mol/promise/like/like.ts
|
|
1329
|
+
;
|
|
1330
|
+
"use strict";
|
|
1331
|
+
var $;
|
|
1322
1332
|
(function ($_1) {
|
|
1323
1333
|
function $mol_test(set) {
|
|
1324
1334
|
for (let name in set) {
|
|
@@ -1337,7 +1347,7 @@ var $;
|
|
|
1337
1347
|
for (let mock of $_1.$mol_test_mocks)
|
|
1338
1348
|
await mock(context);
|
|
1339
1349
|
const res = test(context);
|
|
1340
|
-
if (res
|
|
1350
|
+
if ($mol_promise_like(res)) {
|
|
1341
1351
|
await new Promise((done, fail) => {
|
|
1342
1352
|
res.then(done, fail);
|
|
1343
1353
|
setTimeout(() => fail(new Error('Test timeout: ' + test.name)), 1000);
|