Skip to content

Commit b932450

Browse files
committed
test: improve vm test coverage
1 parent f069793 commit b932450

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-vm-basic.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ const vm = require('vm');
323323
global
324324
);
325325

326+
// Test compileFunction cachedDataProduced 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)