Created
December 7, 2012 01:27
-
-
Save chatrjr/4229999 to your computer and use it in GitHub Desktop.
An example of a simple unit test written with Mocha and expect.js.
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 expect = require("expect.js"); | |
| describe('A simple unit test', function () { | |
| it('should add two integers and return the sum', function () { | |
| // implementation to go here | |
| expect(add(3, 9)).to.be(12); | |
| expect(add('a', 8)).to.not.be.a('number'); | |
| expect(add.length).to.be(2); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment