Skip to content

Commit

Permalink
Failing unit tests for our add and subtract libs
Browse files Browse the repository at this point in the history
  • Loading branch information
cianclarke committed Mar 8, 2016
1 parent 7680bb4 commit 8436053
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/test-lib-addition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var assert = require('assert'),
add = require('../../lib/add');

exports.it_should_add_two_numbers = function(done){
var result = add(1,1);
assert.ok(result === 2);
return done();
};

exports.it_should_add_two_negative_numbers = function(done){
var result = add(-2,-2);
assert.ok(result === -4);
return done();
};
14 changes: 14 additions & 0 deletions test/unit/test-lib-subtraction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var assert = require('assert'),
subtract = require('../../lib/subtract');

exports.it_should_subtract_two_numbers = function(done){
var result = subtract(5,4);
assert.ok(result === 1);
return done();
};

exports.it_should_subtract_two_negative_numbers = function(done){
var result = subtract(-4,-2);
assert.ok(result === -2);
return done();
};

0 comments on commit 8436053

Please sign in to comment.