From b4bc1db2c7498bbe5239dd00d55b3d246a7f361d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Sun, 19 Nov 2023 14:09:25 +0100 Subject: [PATCH] Update the tests --- test/author_test.js | 2 +- test/blog_test.js | 2 +- test/client_test.js | 4 ++-- test/comment_test.js | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/author_test.js b/test/author_test.js index f372a37e..1fbf6a4e 100644 --- a/test/author_test.js +++ b/test/author_test.js @@ -30,7 +30,7 @@ describe("Author", () => { assert.equal(author.email, "cedric@belin.io"); assert.equal(author.ipAddress, "127.0.0.1"); assert.equal(author.role, AuthorRole.administrator); - assert.ok(author.url instanceof URL); + assert(author.url instanceof URL); assert.equal(author.url.href, "https://belin.io/"); assert.equal(author.userAgent, "Mozilla/5.0"); }); diff --git a/test/blog_test.js b/test/blog_test.js index 010d9187..85ed5b1b 100644 --- a/test/blog_test.js +++ b/test/blog_test.js @@ -23,7 +23,7 @@ describe("Blog", () => { assert.equal(blog.charset, "UTF-8"); assert.deepEqual(blog.languages, ["en", "fr"]); - assert.ok(blog.url instanceof URL); + assert(blog.url instanceof URL); assert.equal(blog.url.href, "https://github.com/cedx/akismet.js"); }); }); diff --git a/test/client_test.js b/test/client_test.js index f8adf2aa..068c6337 100644 --- a/test/client_test.js +++ b/test/client_test.js @@ -47,7 +47,7 @@ describe("Client", () => { it("should return `CheckResult.spam` for invalid comment (e.g. spam)", async () => { const isSpam = /** @type {CheckResult[]} */ ([CheckResult.spam, CheckResult.pervasiveSpam]); - assert.ok(isSpam.includes(await client.checkComment(spam))); + assert(isSpam.includes(await client.checkComment(spam))); }); }); @@ -61,7 +61,7 @@ describe("Client", () => { describe("verifyKey()", () => { it("should return `true` for a valid API key", async () => { - assert.ok(await client.verifyKey()); + assert(await client.verifyKey()); }); it("should return `false` for an invalid API key", async () => { diff --git a/test/comment_test.js b/test/comment_test.js index e383432b..d65ed065 100644 --- a/test/comment_test.js +++ b/test/comment_test.js @@ -30,13 +30,13 @@ describe("Comment", () => { user_ip: "127.0.0.1" }); - assert.ok(comment.author instanceof Author); + assert(comment.author instanceof Author); assert.equal(comment.author.ipAddress, "127.0.0.1"); assert.equal(comment.author.name, "Cédric Belin"); assert.equal(comment.content, "A user comment."); - assert.ok(comment.date instanceof Date); + assert(comment.date instanceof Date); assert.equal(comment.date.toISOString(), "2000-01-01T00:00:00.000Z"); - assert.ok(comment.referrer instanceof URL); + assert(comment.referrer instanceof URL); assert.equal(comment.recheckReason, "The comment has been changed."); assert.equal(comment.referrer.href, "https://belin.io/"); assert.equal(comment.type, CommentType.blogPost);