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

Commit 0985a37

Browse files
OrenAvissarpetebacondarwin
authored andcommitted
test(browser/compile): fix calls to Jasmine fail()
The fail() function in Jasmine expects an Error object parameter. Also, there is no global alias for fail() so it must be accessed using `this.fail(new Error())`.
1 parent cb62a57 commit 0985a37

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/ng/browserSpecs.js

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ describe('browser', function() {
271271
browser.cookies('x', longVal + longVal + longVal); //should be too long for all browsers
272272

273273
if (document.cookie !== cookieStr) {
274-
fail("browser didn't drop long cookie when it was expected. make the cookie in this " +
275-
"test longer");
274+
this.fail(new Error("browser didn't drop long cookie when it was expected. make the " +
275+
"cookie in this test longer"));
276276
}
277277

278278
expect(browser.cookies().x).toEqual('shortVal');

test/ng/compileSpec.js

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ describe('$compile', function() {
540540

541541
it('should prevent multiple templates per element', inject(function($compile) {
542542
try {
543-
$compile('<div><span replace class="replace"></span></div>')
544-
fail();
543+
$compile('<div><span replace class="replace"></span></div>');
544+
this.fail(new Error('should have thrown Multiple directives error'));
545545
} catch(e) {
546546
expect(e.message).toMatch(/Multiple directives .* asking for template/);
547547
}

0 commit comments

Comments
 (0)