So I\'m playing around with BDD and mocha with my express.js project. I\'m just getting started so here is what I have as my first test case:
should = requir
if skill.js is in the same path of your test code, try this.
require "./skill.js"
You need to export your Skill class like this:
class Skill
constructor: (@name,@years,@width) ->
module.exports = Skill
And assign it to variable in your test:
should = require "should"
Skill = require "../lib/models/skill.js"
describe 'Skill', ->
describe '#constructor()', ->
it 'should return an instance of class skill', ->
testSkill = new Skill "iOS", "4 years", 100
testSkill.constructor.name.should.equal 'Skill'