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 GitHub committed 2022-02-18 02:51:14 +00:00
1 parent 5c9ea80fa7
commit 82f6b0c25b
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;
}