Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit a313968

Browse files
committed
fix ngScenario/
1 parent 264beb6 commit a313968

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

test/ngScenario/ApplicationSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('angular.scenario.Application', function() {
4848
app.getWindow_ = function() {
4949
return testWindow;
5050
};
51-
app.executeAction(function($window, $document) {
51+
app.executeAction(/** @this **/ function($window, $document) {
5252
expect(this).toEqual(app);
5353
expect($document).toEqual(_jQuery($window.document));
5454
expect($window).toEqual(testWindow);
@@ -176,7 +176,7 @@ describe('angular.scenario.Application', function() {
176176
expect(testWindow.angular.resumeDeferredBootstrap).toBeUndefined();
177177
callLoadHandlers(app);
178178
expect(testWindow.angular.resumeDeferredBootstrap).toBeDefined();
179-
expect(app.rootElement).toBeUndefined;
179+
expect(app.rootElement).toBeUndefined();
180180
expect(injectorSpy).not.toHaveBeenCalled();
181181

182182
var resumeBootstrapSpy = spyOn(testWindow.angular, 'resumeBootstrap').and.returnValue($injector);

test/ngScenario/SpecRunnerSpec.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('angular.scenario.SpecRunner', function() {
5151
}));
5252

5353
it('should bind futures to the spec', function() {
54-
runner.addFuture('test future', function(done) {
54+
runner.addFuture('test future', /** @this **/ function(done) {
5555
this.value = 10;
5656
done();
5757
});
@@ -72,7 +72,7 @@ describe('angular.scenario.SpecRunner', function() {
7272

7373
it('should execute spec function and notify UI', function() {
7474
var finished;
75-
var spec = createSpec('test spec', function() {
75+
var spec = createSpec('test spec', /** @this **/ function() {
7676
this.test = 'some value';
7777
});
7878
runner.addFuture('test future', function(done) {
@@ -94,7 +94,7 @@ describe('angular.scenario.SpecRunner', function() {
9494
it('should execute notify UI on spec setup error', function() {
9595
var finished;
9696
var spec = createSpec('test spec', function() {
97-
throw 'message';
97+
throw new Error('message');
9898
});
9999
runner.run(spec, function() {
100100
finished = true;
@@ -128,9 +128,9 @@ describe('angular.scenario.SpecRunner', function() {
128128

129129
it('should execute notify UI on step error', function() {
130130
var finished;
131-
var spec = createSpec('test spec', function() {
131+
var spec = createSpec('test spec', /** @this **/ function() {
132132
this.addFuture('test future', function(done) {
133-
throw 'error message';
133+
throw new Error('error message');
134134
});
135135
});
136136
runner.run(spec, function() {
@@ -148,9 +148,9 @@ describe('angular.scenario.SpecRunner', function() {
148148

149149
it('should run after handlers even if error in body of spec', function() {
150150
var finished, after;
151-
var spec = createSpec('test spec', function() {
151+
var spec = createSpec('test spec', /** @this **/ function() {
152152
this.addFuture('body', function(done) {
153-
throw 'error message';
153+
throw new Error('error message');
154154
});
155155
});
156156
spec.after = function() {

test/ngScenario/mocks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ angular.scenario.testing.MockRunner.prototype.on = function(eventName, fn) {
2727

2828
angular.scenario.testing.MockRunner.prototype.emit = function(eventName) {
2929
var args = Array.prototype.slice.call(arguments, 1);
30-
angular.forEach(this.listeners[eventName] || [], function(fn) {
30+
angular.forEach(this.listeners[eventName] || [], /** @this **/ function(fn) {
3131
fn.apply(this, args);
3232
});
3333
};

0 commit comments

Comments
 (0)