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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
  • Loading branch information
kuriyosh authored and bengl committed Feb 22, 2022
1 parent afeed46 commit bcf53a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/parallel/test-vm-basic.js
Original file line number Diff line number Diff line change
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 bcf53a8

Please sign in to comment.