From c3109f9458cf09238a7ab47a2ec0fa0e963187bc Mon Sep 17 00:00:00 2001 From: Yoshiki Kurihara Date: Fri, 18 Feb 2022 11:51:14 +0900 Subject: [PATCH] test: improve vm test coverage PR-URL: https://github.com/nodejs/node/pull/41847 Refs: https://coverage.nodejs.org/coverage-cd5689eed3be54a5/lib/vm.js.html#L364 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Daijiro Wachi --- test/parallel/test-vm-basic.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index c6dadce9ad0263..13d212f0079ca7 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -323,6 +323,14 @@ const vm = require('vm'); global ); + // Test compileFunction produceCachedData option + const result = vm.compileFunction('console.log("Hello, World!")', [], { + produceCachedData: true, + }); + + assert.ok(result.cachedDataProduced); + assert.ok(result.cachedData.length > 0); + // Resetting value Error.stackTraceLimit = oldLimit; }