-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add case for errors while console is mocked
The asserted output is not what we'd like it to be. This is just to documnet what happens today. Ref #1340.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
QUnit.module( "Error with mocked console", function( hooks ) { | ||
var orgLog, orgError; | ||
|
||
// Stub | ||
hooks.before( function() { | ||
orgLog = console.log; | ||
orgError = console.error; | ||
console.log = console.error = function() {}; | ||
} ); | ||
|
||
// Restore | ||
hooks.after( function() { | ||
console.error = orgError; | ||
console.log = orgLog; | ||
} ); | ||
|
||
QUnit.test( "bad", function( assert ) { | ||
assert.ok( this.aint() ); | ||
} ); | ||
|
||
QUnit.test( "good", function( assert ) { | ||
assert.ok( 1 ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters