See just how easy and intuitive CoderPad Interview is to use below.
Guidelines to use CoffeeScript in this online IDE
We also have an array of interesting npm packages available for your use:
- underscore and lodash for many useful functional helpers.
- chai, sinon, sinon-chai, and mocha testing libraries.
Here’s a quick example of how to use
chai = require('chai') sinon = require('sinon') sinonChai = require('sinon-chai') hello = (name, cb) -> cb 'hello ' + name return chai.should() chai.use sinonChai cb = sinon.spy() hello 'world', cb cb.should.have.been.calledWith 'this test should fail'Code language: CoffeeScript (coffeescript)
as well as
Mocha = require('mocha') assert = require('assert') mocha = new Mocha # Bit of a hack, sorry! mocha.suite.emit 'pre-require', this, 'solution', mocha describe 'Test suite', -> it 'should work', -> assert true mocha.run()Code language: CoffeeScript (coffeescript)
- You can use async, request, and isomorphic-fetch for making async HTTP a little more convenient.
- q and bluebird are promise libraries to help make managing async in general easier.
- jsdom is a library for mimicking an HTML DOM within our JS environment. Useful if you want to manipulate elements without using our full HTML/CSS/JS environment.