Created
September 14, 2016 19:27
-
-
Save msecret/6d9022fd47438cd75e094ae20d80bfba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var main = require('../src/main.js'); | |
describe('main', function() { | |
describe('init()', function() { | |
it('set the name property to the name passed in', function() { | |
}); | |
}); | |
describe('calculate()', function() { | |
it('should add the number to 5', function() { | |
var testNum = 1; | |
var expected = testNum + 5; | |
var actual = main.calculate(testNum); | |
assert(actual === expected); | |
}); | |
it('should return nothing if you pass in non-number', function() { | |
var testVal = 'something'; | |
var expected = undefined; | |
var actual = main.calculate(testVal); | |
assert(actual === expected); | |
}); | |
}); | |
}); | |
var main = { | |
init: function(name) { | |
this.name = name; | |
}, | |
calculate(num: number) { | |
return num + 5; | |
} | |
}; | |
module.exports = main; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment