Skip to content

Commit

Permalink
Tests: Included console in VM context (#2353)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed May 18, 2020
1 parent d605577 commit b4ed5de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/helper/prism-loader.js
Expand Up @@ -153,6 +153,9 @@ module.exports = {
* @returns {*}
*/
runFileWithContext(fileSource, context = {}) {
// we don't have to pass our console but it's the only way these scripts can talk
// not supplying console here means that all references to `console` inside them will refer to a no-op console
context.console = console;
vm.runInNewContext(fileSource, context);
return context;
}
Expand Down

0 comments on commit b4ed5de

Please sign in to comment.