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 <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
Yoshiki Kurihara authored and Bryan English committed 2022-02-22 11:38:55 -05:00
1 parent afeed46578
commit bcf53a89f7
1 file changed
+8
+8
View File
@@ -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;
}