Skip to content

Instantly share code, notes, and snippets.

@mitchallen
Created April 3, 2023 01:57
Show Gist options
  • Save mitchallen/06f70c15bd8409c341549ee5b9e16d11 to your computer and use it in GitHub Desktop.
Save mitchallen/06f70c15bd8409c341549ee5b9e16d11 to your computer and use it in GitHub Desktop.
Example mocha test for verifying a simple tool module
'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