Created
December 2, 2014 14:28
-
-
Save dervalp/db4d2fbfce3a80ac8b94 to your computer and use it in GitHub Desktop.
unit test Component (even in node.js env)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handlebars = require("handlebars"); | |
global.__speak_config = { | |
template: handlebars | |
}; | |
var Speak = require( "../../src/index" ), | |
should = require( "should" ); | |
Speak.component({ | |
name: "test", | |
initialize: function () { | |
console.log("initialize"); | |
} | |
}); | |
var component = Speak.component("test"); | |
describe("Given Speak", function() { | |
it("should be defined", function (){ | |
Speak.should.be.defined; | |
}); | |
it("component method should exist", function (){ | |
Speak.component.should.exist; | |
}); | |
it("create a component", function (){ | |
component.should.exist; | |
component.initialize.should.exist; | |
}); | |
it("should be able to instanciate", function (){ | |
var compProperties = { | |
key: "test", | |
id: "IdComponent" | |
}; | |
var componentInstantiated = Speak.exposeComponent( compProperties, {} ); | |
componentInstantiated.should.exist; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment