Skip to content

Commit

Permalink
Updated the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed May 3, 2017
1 parent 701f481 commit 679de60
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/author_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Author', () => {
});

expect(author.email).to.equal('[email protected]');
expect(author.url.href).to.equal('https://belin.io/');
expect(author.url).to.be.instanceOf(URL).and.have.property('href').that.equal('https://belin.io/');
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/blog_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Blog', () => {
expect(blog.languages).to.be.an('array').and.have.lengthOf(2);
expect(blog.languages[0]).to.equal('en');
expect(blog.languages[1]).to.equal('fr');
expect(blog.url.href).to.equal('https://github.com/cedx/akismet.js');
expect(blog.url).to.be.instanceOf(URL).and.have.property('href').that.equal('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 @@ -72,7 +72,7 @@ describe('Client', function() {
let data = client.toJSON();
expect(data.apiKey).to.equal('0123456789-ABCDEF');
expect(data.blog).to.be.null;
expect(data.endPoint.href).to.equal('http://localhost/');
expect(data.endPoint).to.be.instanceOf(URL).and.have.property('href').that.equal('http://localhost/');
expect(data.isTest).to.be.false;
expect(data.userAgent).to.equal('FooBar/6.6.6');
});
Expand All @@ -82,7 +82,7 @@ describe('Client', function() {
expect(Object.keys(data)).to.have.lengthOf(5);
expect(data.apiKey).to.equal(process.env.AKISMET_API_KEY);
expect(data.blog).to.equal('Blog');
expect(data.endPoint.href).to.equal(Client.DEFAULT_ENDPOINT.href);
expect(data.endPoint).to.be.instanceOf(URL).and.have.property('href').that.equal(Client.DEFAULT_ENDPOINT.href);
expect(data.isTest).to.be.true;
expect(data.userAgent.startsWith('Node.js/')).to.be.true;
});
Expand Down
2 changes: 1 addition & 1 deletion test/comment_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Comment', () => {
expect(comment.content).to.equal('A user comment.');
expect(comment.date).to.be.instanceof(Date);
expect(comment.date.getFullYear()).to.equal(2000);
expect(comment.referrer.href).to.equal('https://belin.io/');
expect(comment.referrer).to.be.instanceOf(URL).and.have.property('href').that.equal('https://belin.io/');
expect(comment.type).to.equal(CommentType.TRACKBACK);
});
});
Expand Down

0 comments on commit 679de60

Please sign in to comment.