Created
September 28, 2017 16:12
-
-
Save mcranston18/0ded29eca9a53efeb945736b0a053061 to your computer and use it in GitHub Desktop.
Component testing
This file contains hidden or 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('myComponent', function() { | |
var $ctrl; | |
var $rootScope; | |
var $scope; | |
beforeEach(module('theNameOfMyAngularApp')); | |
beforeEach(inject(function(_$rootScope_, _$componentController_) { | |
$rootScope = _$rootScope_; | |
$scope = $rootScope.$new(); | |
$ctrl = _$componentController_('myComponent', { | |
$scope: $scope | |
}, { | |
params: {}, | |
response: {}, | |
query: sinon.stub().returns(promise.promise) | |
}); | |
$ctrl.$onInit(); | |
})); | |
describe('$ctrl.someMethod', function() { | |
it('...', function() { | |
// expect(true).to.be(true); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment