Commit 213ca3fa by valera-rozuvan Committed by Valera Rozuvan

Work on RequireJS Jasmine test.

parent fd0ec0ed
...@@ -25,24 +25,27 @@ describe "RequireJS namespacing", -> ...@@ -25,24 +25,27 @@ describe "RequireJS namespacing", ->
describe "RequireJS module creation", -> describe "RequireJS module creation", ->
inCallback = undefined inDefineCallback = undefined
it "check that we can use RequireJS.define() to create a module", -> inRequireCallback = undefined
it "check that we can use RequireJS define() and require() a module", ->
runs -> runs ->
inCallback = false inDefineCallback = false
RequireJS.define [], -> inRequireCallback = false
inCallback = true RequireJS.define "test_module", [], ->
inDefineCallback = true
module_status: "OK" module_status: "OK"
RequireJS.require "test_module", (test_module) ->
inRequireCallback = true
expects(test_module.module_status).toBe "OK"
waitsFor (-> waitsFor (->
inCallback return false if (inDefineCallback isnt true) or (inRequireCallback isnt true)
true
), "We should eventually end up in the defined callback", 1000 ), "We should eventually end up in the defined callback", 1000
runs -> runs ->
expects(inCallback).toBeTruthy() expects(inDefineCallback).toBeTruthy()
expects(inRequireCallback).toBeTruthy()
# it('check that we can use RequireJS.require() to get our defined module', function () {
# });
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment