-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(context): Future-proofed context.html and debug.html for mod…
…ularity BREAKING CHANGE: Our `context.html` and `debug.html` structures have changed to lean on `context.js` and `debug.js`. This is in preparation for deeper `context.js` changes in #1984. As a result, all `customContextFile` and `customDebugFile` options much update their format to match this new format.
- Loading branch information
Showing
7 changed files
with
60 additions
and
52 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
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,13 @@ | ||
// Define a placeholder for Karma to be defined via the parent window | ||
// DEV: This is a placeholder change for upcoming edits in https://github.com/karma-runner/karma/pull/1984 | ||
window.__karma__ = { | ||
setupContext: function (contextWindow) { | ||
// sets window.__karma__ and overrides console and error handling | ||
// Use window.opener if this was opened by someone else - in a new window | ||
if (contextWindow.opener) { | ||
contextWindow.opener.karma.setupContext(contextWindow) | ||
} else { | ||
contextWindow.parent.karma.setupContext(contextWindow) | ||
} | ||
} | ||
} |
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,29 @@ | ||
// Override the Karma setup for local debugging | ||
window.__karma__.info = function (info) { | ||
if (info.dump && window.console) window.console.log(info.dump) | ||
} | ||
window.__karma__.complete = function () { | ||
if (window.console) window.console.log('Skipped ' + this.skipped + ' tests') | ||
} | ||
window.__karma__.store = function () {} | ||
window.__karma__.skipped = 0 | ||
window.__karma__.result = window.console ? function (result) { | ||
if (result.skipped) { | ||
this.skipped++ | ||
return | ||
} | ||
var msg = result.success ? 'SUCCESS ' : 'FAILED ' | ||
window.console.log(msg + result.suite.join(' ') + ' ' + result.description) | ||
|
||
for (var i = 0; i < result.log.length; i++) { | ||
// Throwing error without losing stack trace | ||
(function (err) { | ||
setTimeout(function () { | ||
throw err | ||
}) | ||
})(result.log[i]) | ||
} | ||
} : function () {} | ||
window.__karma__.loaded = function () { | ||
this.start() | ||
} |
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