Skip to content

Instantly share code, notes, and snippets.

@aterreno
Created December 16, 2020 19:19
Show Gist options
  • Save aterreno/dee5613336f1505a9df7ecc6336215c9 to your computer and use it in GitHub Desktop.
Save aterreno/dee5613336f1505a9df7ecc6336215c9 to your computer and use it in GitHub Desktop.
https://coderpad.io/sandbox in javascript with mocha tests
const Mocha = require ('mocha')
const assert = require('chai').assert
const mocha = new Mocha ({ui: 'bdd'})
mocha.suite.emit('pre-require', this, 'solution', mocha)
const even = (n) => n % 2 === 0;
describe('Test suite', () => {
it('should work', () => {
assert(even(2) === true, "two is even")
})
it('should work', () => {
assert(even(3) === false, "three is not even")
})
})
mocha.run(() => {})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment