From e08cf9966eecba025fb617dad51ae48e4fb79b5d Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 19 May 2020 01:47:03 +0200 Subject: [PATCH] Tests: Included console in VM context (#2353) --- tests/helper/prism-loader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/helper/prism-loader.js b/tests/helper/prism-loader.js index 7bc07487c9..58522e96ed 100644 --- a/tests/helper/prism-loader.js +++ b/tests/helper/prism-loader.js @@ -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; }