mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
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:
parent
cb62a57d43
commit
0985a37376
2 changed files with 4 additions and 4 deletions
4
test/ng/browserSpecs.js
Normal file → Executable file
4
test/ng/browserSpecs.js
Normal file → Executable 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
4
test/ng/compileSpec.js
Normal file → Executable 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/);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue