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())`.
This commit is contained in:
Oren Avissar 2013-04-22 21:00:15 -07:00 committed by Pete Bacon Darwin
parent cb62a57d43
commit 0985a37376
2 changed files with 4 additions and 4 deletions

4
test/ng/browserSpecs.js Normal file → Executable file
View file

@ -271,8 +271,8 @@ describe('browser', function() {
browser.cookies('x', longVal + longVal + longVal); //should be too long for all browsers
if (document.cookie !== cookieStr) {
fail("browser didn't drop long cookie when it was expected. make the cookie in this " +
"test longer");
this.fail(new Error("browser didn't drop long cookie when it was expected. make the " +
"cookie in this test longer"));
}
expect(browser.cookies().x).toEqual('shortVal');

4
test/ng/compileSpec.js Normal file → Executable file
View file

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