mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1249106 - Fail tests when React propType errors are logged. r=jyrans
MozReview-Commit-ID: HlTDuMhsyX6
This commit is contained in:
parent
88e03421ff
commit
1d48126258
@ -40,6 +40,26 @@ waitForExplicitFinish();
|
||||
// Uncomment this pref to dump all devtools emitted events to the console.
|
||||
// Services.prefs.setBoolPref("devtools.dump.emit", true);
|
||||
|
||||
/**
|
||||
* Watch console messages for failed propType definitions in React components.
|
||||
*/
|
||||
const ConsoleObserver = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
|
||||
|
||||
observe: function(subject, topic, data) {
|
||||
var message = subject.wrappedJSObject.arguments[0];
|
||||
|
||||
if (/Failed propType/.test(message)) {
|
||||
ok(false, message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Services.obs.addObserver(ConsoleObserver, "console-api-log-event", false);
|
||||
registerCleanupFunction(() => {
|
||||
Services.obs.removeObserver(ConsoleObserver, "console-api-log-event");
|
||||
});
|
||||
|
||||
function getFrameScript() {
|
||||
let mm = gBrowser.selectedBrowser.messageManager;
|
||||
let frameURL = "chrome://devtools/content/shared/frame-script-utils.js";
|
||||
|
Loading…
Reference in New Issue
Block a user