Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

Commit 1067645

Browse files
committed
fix(app): create new $scope for controller tests
Creating new $scope for controller tests both is good practice and prevents the grunt task failing on a clean install due to jshint warnings.
1 parent 3eb78fe commit 1067645

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/javascript/spec/controller.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
describe('Controller: <%= classedName %>Ctrl', function () {
4+
var scope;
45

56
// load the controller's module
67
beforeEach(module('<%= scriptAppName %>'));
@@ -9,7 +10,9 @@ describe('Controller: <%= classedName %>Ctrl', function () {
910

1011
// Initialize the controller and a mock scope
1112
beforeEach(inject(function ($controller, $rootScope) {
13+
scope = $rootScope.$new();
1214
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', {
15+
$scope: scope
1316
// place here mocked dependencies
1417
});
1518
}));

0 commit comments

Comments
 (0)