The snapshotted stack frames should hide node internal stack frames so that general node core development does not need updating the snapshot. For userland stack frames, they are highly fixture related and any fixture change should reflect in a change of the snapshot. Additionally, the line and column number are highly relevant to the correctness of the snapshot, these should not be redacted. A change in node core that affects userland stack frames should be alarming and be reflected in the snapshots. Features like test runner and source map support both should snapshot userland stack frames to ensure that userland code locations are computed correctly. PR-URL: https://github.com/nodejs/node/pull/61665 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
19 lines
696 B
JavaScript
19 lines
696 B
JavaScript
import '../common/index.mjs';
|
|
import * as fixtures from '../common/fixtures.mjs';
|
|
import * as snapshot from '../common/assertSnapshot.js';
|
|
import { describe, it } from 'node:test';
|
|
|
|
describe('vm output', { concurrency: !process.env.TEST_PARALLEL }, () => {
|
|
const tests = [
|
|
{ name: 'vm/vm_caught_custom_runtime_error.js' },
|
|
{ name: 'vm/vm_display_runtime_error.js' },
|
|
{ name: 'vm/vm_display_syntax_error.js' },
|
|
{ name: 'vm/vm_dont_display_runtime_error.js' },
|
|
{ name: 'vm/vm_dont_display_syntax_error.js' },
|
|
];
|
|
for (const { name } of tests) {
|
|
it(name, async () => {
|
|
await snapshot.spawnAndAssert(fixtures.path(name), snapshot.defaultTransform);
|
|
});
|
|
}
|
|
});
|