Skip to content

Instantly share code, notes, and snippets.

@brian428
Created September 6, 2012 04:12
Show Gist options
  • Save brian428/3651123 to your computer and use it in GitHub Desktop.
Save brian428/3651123 to your computer and use it in GitHub Desktop.
Basic Jasmine Test
describe "During initialization and setup, the application...", ->
it "has loaded ExtJS 4", ->
expect( Ext ).toBeDefined()
expect( Ext.getVersion() ).toBeTruthy()
expect( Ext.getVersion().major ).toEqual( 4 )
it "has loaded Application with expected Application name", ->
expect( window.Application ).toBeDefined()
expect( window.Application.name ).toEqual( "JasmineExample" )
it "has created DeftJS IoC items", ->
expect( Deft.ioc.Injector.canResolve( "companyStore" ) ).toBeTruthy()
expect( Deft.ioc.Injector.canResolve( "some_$unknown$_alias" ) ).toBeFalsy()
it "can inject dependencies into a target object", ->
target =
companyStore: null
someOtherProperty: null
config: {}
Deft.ioc.Injector.inject( "companyStore", target )
expect( target.companyStore ).toBeTruthy()
expect( target.someOtherProperty ).toBeFalsy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment