Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #19 from lhotari/lh-log-jsDomErrors
Browse files Browse the repository at this point in the history
Log all jsDomErrors when using the default jsdom testEnvironment in jest
  • Loading branch information
lapanti committed Apr 23, 2017
2 parents acec00b + 0640fb3 commit 48c4124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"ts",
"tsx",
"js"
]
],
"setupTestFrameworkScriptFile": "<rootDir>/src/jest/setup.js"
},
"scripts": {
"lint:sass": "sass-lint src/**/*.scss -v --max-warnings 1",
Expand Down
4 changes: 4 additions & 0 deletions src/jest/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Log all jsDomErrors when using jsdom testEnvironment
window._virtualConsole && window._virtualConsole.on('jsdomError', function (error) {
console.error('jsDomError', error.stack, error.detail);
});

0 comments on commit 48c4124

Please sign in to comment.