Skip to content

Commit b8fa07c

Browse files
harryadelBastienRodz
authored andcommitted
Assert values using test.equal in basic test
1 parent f764fcb commit b8fa07c

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

tests/basic.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Tinytest.addAsync("Basic", async function (test) {
1414

1515
console.log("--- 0 ---")
1616
var clear = await Jobs.clear("*")
17-
console.log(clear)
18-
17+
test.equal(clear, 1);
18+
1919
// 1 - Register the Job
2020

2121
Jobs.register({
@@ -49,16 +49,13 @@ Tinytest.addAsync("Basic", async function (test) {
4949
console.log("Job doc after creation:")
5050
console.log(jobDoc);
5151

52-
if (jobDoc.due.getYear() === targetYear) {
53-
console.log("Date looks fine")
54-
} else {
55-
console.log("Error around due date check")
56-
}
52+
test.equal(jobDoc.due.getYear(), targetYear);
5753

5854
// 4 - Cancel the job
5955

6056
var cancel = await Jobs.cancel(jobId);
61-
57+
test.equal(cancel, 1)
58+
6259
// 5 - Check the job was canceled
6360

6461
var jobDoc = await Jobs.get(jobId);
@@ -67,11 +64,7 @@ Tinytest.addAsync("Basic", async function (test) {
6764
console.log("Job doc after cancel:")
6865
console.log(jobDoc)
6966

70-
if (jobDoc.state === "cancelled") {
71-
console.log("Job was cancelled")
72-
} else {
73-
console.log("Job cancel failed")
74-
}
67+
test.equal(jobDoc.state, "cancelled");
7568

7669
// 6 - Log whatever is in the collection
7770

0 commit comments

Comments
 (0)