Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Commit

Permalink
Added exceptions testing for 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kachok committed Apr 21, 2014
1 parent 5926428 commit 6866191
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test-compare-partial.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ before(function(done) {

describe('Matching library (compare-partial.js) tests', function () {

describe('Exceptions test', function () {
it('testing exceptions', function () {
var fn = function(){ compare("none", "none")({"a":1},{"a":1}); };
expect(fn).to.throw('one argument is required for compare function');
fn = function(){ compare()({"a":1},{"a":1}); };
expect(fn).to.throw('one argument is required for compare function');

});
});

describe('Entries level tests', function () {
it('testing compare method', function () {

Expand Down
14 changes: 14 additions & 0 deletions test/test-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ before(function(done) {

describe('Matching library (compare.js) tests', function () {

describe('Exceptions test', function () {
it('testing exceptions', function () {
var fn = function(){ compare({"a":1},{"a":1},{"a":1}); };
expect(fn).to.throw('two arguments are required for compare function');

fn = function(){ compare({"a":1}); };
expect(fn).to.throw('two arguments are required for compare function');

fn = function(){ compare(); };
expect(fn).to.throw('two arguments are required for compare function');

});
});

describe('Entries level tests', function () {
it('testing compare method', function () {
//expect(true).to.equal(true);
Expand Down

0 comments on commit 6866191

Please sign in to comment.