Created
October 15, 2013 01:27
-
-
Save ThomasBurleson/6985173 to your computer and use it in GitHub Desktop.
Sample Spec as part of comments "AngularJS - Using Decorators for UnitTesting"
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
describe("worldGreeter Tests", function() | |
{ | |
beforeEach( function() | |
{ | |
module( 'test.myApp' ); | |
/** | |
* Configure disposable module with values and factories | |
*/ | |
module( function( $provide ) | |
{ | |
var Greeter = function() | |
{ | |
return 'Bye'; | |
}, | |
WorldGreeter = ["greeter", function( greeter ) | |
{ | |
return greeter + " World"; | |
}]; | |
$provide.factory( 'greeter', Greeter ); | |
$provide.factory( 'worldGreeter', WorldGreeter ); | |
}); | |
}); | |
it( 'should work with mocked WorldGreeter', function ( worldGreeter ) | |
{ | |
expect( worldGreeter ).toBe( 'Bye World' ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AngularJS - Using Decorators for UnitTesting