Skip to content

Commit 0461729

Browse files
kuriyoshbengl
authored andcommitted
test: improve vm test coverage
PR-URL: #41847 Refs: https://coverage.nodejs.org/coverage-cd5689eed3be54a5/lib/vm.js.html#L364 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
1 parent 297d217 commit 0461729

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-vm-basic.js

+8
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ const vm = require('vm');
323323
global
324324
);
325325

326+
// Test compileFunction produceCachedData option
327+
const result = vm.compileFunction('console.log("Hello, World!")', [], {
328+
produceCachedData: true,
329+
});
330+
331+
assert.ok(result.cachedDataProduced);
332+
assert.ok(result.cachedData.length > 0);
333+
326334
// Resetting value
327335
Error.stackTraceLimit = oldLimit;
328336
}

0 commit comments

Comments
 (0)