Skip to content

Instantly share code, notes, and snippets.

@josephmcasey
Last active June 3, 2018 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephmcasey/f616baffc9e3cdc5b32daf500a896436 to your computer and use it in GitHub Desktop.
Save josephmcasey/f616baffc9e3cdc5b32daf500a896436 to your computer and use it in GitHub Desktop.
Coder Pad JavaScript Template
/* Imports & Setup */
const _ = require('lodash');
const Mocha = require('mocha')
const mocha = new Mocha()
const chai = require('chai')
const sinon = require('sinon')
const sChai = require('sinon-chai')
mocha.suite.emit('pre-require', this, 'solution', mocha) // Bit of a hack, sorry!
chai.should()
chai.use(sinonChai)
/*
Problem Set Name:
Space Complexity:
Time Complexity:
*/
/* Tests */
describe('Test suite', function() {
let spy
beforeEach(() => {
spy = sinon.spy()
})
it('Sanity Check', () => {
hello('world', spy)
spy.should.have.been.calledWith('hello world')
spy.should.have.been.called
function hello(name, cb) {
cb('hello ' + name)
}
})
it('Should Work', () => {
})
})
mocha.run()
/* Implementation */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment