Skip to content

Commit d0c3e4c

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

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.equal(result.cachedDataProduced, true);
332+
assert.equal(result.cachedData.length > 0, true);
333+
326334
// Resetting value
327335
Error.stackTraceLimit = oldLimit;
328336
}

0 commit comments

Comments
 (0)