DEV: make tests good

This commit is contained in:
Gabriel Grubba
2025-11-11 10:58:18 -03:00
parent 4d4f6661af
commit 64cc7937f9

View File

@@ -43,21 +43,35 @@ Tinytest.addAsync(
{ on: [] }
);
test.equal(x, "b");
onComplete();
}
);
Tinytest.addAsync(
"timers - defer works with async functions",
async function (test, onComplete) {
let x = "a";
"timers - deferrable works with async functions",
function (test, onComplete) {
let x = Meteor.deferrable(
function () {
return "start value";
},
{ on: [] }
);
test.equal(x, "start value");
Meteor.deferrable(
async function () {
await new Promise((resolve) => setTimeout(resolve, 10));
test.equal(x, "b");
function () {
test.equal(x, "value");
onComplete();
},
{ on: ["development", "production", "test"] }
);
await Meteor.deferrable(async () => (x = "b"), { on: [] });
Meteor.deferrable(
async function () {
return "value";
},
{ on: [] }
).then((value) => (x = value));
}
);