Work on RequireJS Jasmine test.

This commit is contained in:
valera-rozuvan
2012-12-05 09:44:08 +02:00
committed by Valera Rozuvan
parent 7cf848db9e
commit 8af93229d3

View File

@@ -1,12 +1,18 @@
describe "RequireJS", ->
it "check that the RequireJS object is present in the global namespace", ->
expect(RequireJS).toEqual jasmine.any(Object)
expect(window.RequireJS).toEqual jasmine.any(Object)
beforeEach ->
@addMatchers requirejsTobeUndefined: ->
typeof requirejs is "undefined"
it "check that requirejs(), require(), and define() are not in the global namespace", ->
expect(requirejs).not.toBeDefined()
expect(require).not.toBeDefined()
expect(define).not.toBeDefined()
expect(window.requirejs).not.toBeDefined()
expect(window.require).not.toBeDefined()
expect(window.define).not.toBeDefined()
it "check that the RequireJS object is present in the global namespace", ->
expect(RequireJS).toEqual jasmine.any(Object)
expect(window.RequireJS).toEqual jasmine.any(Object)
it "check that requirejs(), require(), and define() are not in the global namespace", ->
expect({}).requirejsTobeUndefined()
# expect(require).not.toBeDefined();
# expect(define).not.toBeDefined();
expect(window.requirejs).not.toBeDefined()
expect(window.require).not.toBeDefined()
expect(window.define).not.toBeDefined()