Improve support of node 10.x
diff --git a/tests/helper/components.js b/tests/helper/components.js
index 09dd6aa..68cb7ab 100644
--- a/tests/helper/components.js
+++ b/tests/helper/components.js
@@ -5,7 +5,6 @@ var vm = require("vm");
var fileContent = fs.readFileSync(__dirname + "/../../components.js", "utf8");
var context = {};
-vm.createContext(context);
-vm.runInContext(fileContent, context);
+vm.runInNewContext(fileContent, context);
module.exports = context.components;
diff --git a/tests/helper/prism-loader.js b/tests/helper/prism-loader.js
index 9bc515b..31f3689 100644
--- a/tests/helper/prism-loader.js
+++ b/tests/helper/prism-loader.js
@@ -107,8 +107,7 @@ module.exports = {
*/
runFileWithContext: function (fileSource, context) {
context = context || {};
- vm.createContext(context);
- vm.runInContext(fileSource, context);
+ vm.runInNewContext(fileSource, context);
return context;
}
};