Skip to content

Commit

Permalink
Temporarily disable console error check in test-amp-analytics.js unti… (
Browse files Browse the repository at this point in the history
#15606)

* Temporarily disable console error check in test-amp-analytics.js until we have a solution to catch async console errors.

* Fix linter
  • Loading branch information
lannka authored May 25, 2018
1 parent a63b728 commit df9fab8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"context": false,
"global": false,
"describes": true,
"allowConsoleError": false
"allowConsoleError": false,
"dontWarnForConsoleError": false,
"warnForConsoleError": false
},
"settings": {
"jsdoc": {
Expand Down
7 changes: 7 additions & 0 deletions extensions/amp-analytics/0.1/test/test-amp-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ describes.realWin('amp-analytics', {
};

beforeEach(() => {
// Temporarily disable console error check until we have a solution
// to catch async console errors.
dontWarnForConsoleError();
win = env.win;
doc = win.document;
ampdoc = env.ampdoc;
Expand Down Expand Up @@ -116,6 +119,10 @@ describes.realWin('amp-analytics', {
});
});

afterEach(() => {
warnForConsoleError();
});

function getAnalyticsTag(config, attrs) {
config = JSON.stringify(config);
const el = doc.createElement('amp-analytics');
Expand Down
2 changes: 2 additions & 0 deletions test/_init_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ let initialWindowState;

// All exposed describes.
global.describes = describes;
global.dontWarnForConsoleError = dontWarnForConsoleError;
global.warnForConsoleError = warnForConsoleError;

// Increase the before/after each timeout since certain times they have timedout
// during the normal 2000 allowance.
Expand Down

0 comments on commit df9fab8

Please sign in to comment.