Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Created December 2, 2015 21:59
Show Gist options
  • Save samueleresca/cc633004736213f60b6a to your computer and use it in GitHub Desktop.
Save samueleresca/cc633004736213f60b6a to your computer and use it in GitHub Desktop.
//FIX to the error : "expect is not defined"
var expect = chai.expect;
//describe Telefilm tests
describe('Telefilm', function() {
//Before the execution, initialize the object
before(function() {
this.telefilm = new Telefilm("Scrubs", ["John Dorian"]);
});
//LIst of tests
it('should be able to init new telefilm object', function() {
expect(this.telefilm).to.exist;
});
it('should be able to get characters', function() {
expect(this.telefilm.getCharacters()).to.ok;
});
it('should be able to get name', function() {
expect(this.telefilm.getName()).to.ok;
});
it('should be able to add character', function(){
var localTelefilm= new Telefilm("Scrubs",[]);
localTelefilm.addCharacter("Elliot Reid");
expect(localTelefilm.getCharacters().length).to.be.equals(1);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment