Skip to content

Instantly share code, notes, and snippets.

@mitchallen
Created April 3, 2023 02:04
Show Gist options
  • Save mitchallen/4a866a299ce0a69671fbbec9b9a3ddf7 to your computer and use it in GitHub Desktop.
Save mitchallen/4a866a299ce0a69671fbbec9b9a3ddf7 to your computer and use it in GitHub Desktop.
An example of testing a main component
"use strict";
var assert = require('assert');
const demoMain = require('..');
describe('demo-main', function () {
context('smoke test', function () {
it('should add first two numbers and subtract the third', function (done) {
const a = 100, b = 200, c = 50;
const expected = a + b - c;
assert.strictEqual(demoMain( a, b, c ), expected );
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment