mol_crypto_lib 0.0.667 → 0.0.668

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
@@ -1063,6 +1063,16 @@ var $;
1063
1063
  ;
1064
1064
  "use strict";
1065
1065
  var $;
1066
+ (function ($) {
1067
+ function $mol_promise_like(val) {
1068
+ return val && typeof val.then === 'function';
1069
+ }
1070
+ $.$mol_promise_like = $mol_promise_like;
1071
+ })($ || ($ = {}));
1072
+ //mol/promise/like/like.ts
1073
+ ;
1074
+ "use strict";
1075
+ var $;
1066
1076
  (function ($_1) {
1067
1077
  function $mol_test(set) {
1068
1078
  for (let name in set) {
@@ -1081,7 +1091,7 @@ var $;
1081
1091
  for (let mock of $_1.$mol_test_mocks)
1082
1092
  await mock(context);
1083
1093
  const res = test(context);
1084
- if (res instanceof Promise) {
1094
+ if ($mol_promise_like(res)) {
1085
1095
  await new Promise((done, fail) => {
1086
1096
  res.then(done, fail);
1087
1097
  setTimeout(() => fail(new Error('Test timeout: ' + test.name)), 1000);