Skip to content

Commit

Permalink
build: re-enable console warning reporting in e2e tests (#4199)
Browse files Browse the repository at this point in the history
Reverts commit a8b2575 and adds a webpack loader
to remove from bootstrap during the e2e-app build the :lang(en) selector that causes
the warning.
  • Loading branch information
divdavem committed Dec 14, 2021
1 parent c8c7487 commit 93a4efd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions e2e-app/coverage.webpack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
module.exports = {
module: {
rules: [
{
test: /bootstrap\.css$/,
use: [
{
// This loader is used to remove from bootstrap during the e2e-app build
// the :lang(en) selector that causes a warning.
loader: require.resolve('./removeLangSelector'),
},
],
},
{
test: /\.(js|ts)$/,
use: [
Expand Down
5 changes: 5 additions & 0 deletions e2e-app/removeLangSelector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This loader is used to remove from bootstrap during the e2e-app build
// the :lang(en) selector that causes a warning.
module.exports = function (file) {
return file.replace(/:lang\(en\)/g, "");
};
2 changes: 1 addition & 1 deletion e2e-app/setup.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beforeAll(async() => {
// Listen for all console events and handle errors
test.page.on('console', async msg => {
const type = msg.type();
if (type === 'error') {
if (type === 'error' || type === 'warning') {
const output = ['Unexpected console error:'];
for (const m of msg.args()) {
output.push(await m.jsonValue());
Expand Down

0 comments on commit 93a4efd

Please sign in to comment.