Skip to content

Instantly share code, notes, and snippets.

@bmorelli25
Last active June 7, 2017 01:04
Show Gist options
  • Save bmorelli25/6aa97f447b6ac842eb6e0b35fc0cd7ed to your computer and use it in GitHub Desktop.
Save bmorelli25/6aa97f447b6ac842eb6e0b35fc0cd7ed to your computer and use it in GitHub Desktop.
Mocha Test Answer
// Require the built in 'assertion' library
var assert = require('assert');
// Create a test suite (group) called Math
describe('Math', function() {
// Test One: A string explanation of what we're testing
it('should test if 3*3 = 9', function(){
// Our actual test: 3*3 SHOULD EQUAL 9
assert.equal(9, 3*3);
});
// Test Two: A string explanation of what we're testing
it('should test if (3-4)*8 = -8', function(){
// Our actual test: (3-4)*8 SHOULD EQUAL -8
assert.equal(-8, (3-4)*8);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment