Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Spec as part of comments "AngularJS - Using Decorators for UnitTesting"
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' );
});
});
@ThomasBurleson

This comment has been minimized.

Copy link
Owner Author

commented Oct 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.