Skip to content

Commit

Permalink
test: improve vm test coverage
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
kuriyosh authored and danielleadams committed Apr 24, 2022
1 parent 06d8c53 commit 2a1a94b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-vm-basic.js
Expand Up @@ -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;
}

0 comments on commit 2a1a94b

Please sign in to comment.