diff options
author | Yoshiki Kurihara <yosyos0306@gmail.com> | 2022-02-18 11:51:14 +0900 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2022-04-23 22:26:06 -0400 |
commit | 2a1a94bbbbe6afa69cc076f8caf2e40ae70379f8 (patch) | |
tree | f8e28b8fe734afacb7f63c263fdd989f4aa557a4 /test | |
parent | 06d8c53e623eda3241dbd878033b5f54253bacb9 (diff) | |
download | node-new-2a1a94bbbbe6afa69cc076f8caf2e40ae70379f8.tar.gz |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-vm-basic.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index c6dadce9ad..13d212f007 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -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; } |