Skip to content

Commit

Permalink
Update the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Nov 19, 2023
1 parent f30134b commit b4bc1db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/author_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("Author", () => {
assert.equal(author.email, "[email protected]");
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");
});
Expand Down
2 changes: 1 addition & 1 deletion test/blog_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/client_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
});
});

Expand All @@ -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 () => {
Expand Down
6 changes: 3 additions & 3 deletions test/comment_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b4bc1db

Please sign in to comment.