Created
April 3, 2023 01:57
-
-
Save mitchallen/06f70c15bd8409c341549ee5b9e16d11 to your computer and use it in GitHub Desktop.
Example mocha test for verifying a simple tool module
This file contains 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
'use strict'; | |
var assert = require('assert'); | |
const demoTools = require('..'); | |
describe('demo-tools', function () { | |
context('smoke test', function () { | |
it('add should add two numbers together', function (done) { | |
assert.strictEqual(demoTools.add(100,200),300); | |
done(); | |
}); | |
it('subtract should subtract one number from another', function (done) { | |
assert.strictEqual(demoTools.subtract(100,200),-100); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment