mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
Unifes assertSnapshot common patterns like platform specific path separators, line ending, line trailing spaces, Node.js version strings, and pids in warning messages. PR-URL: https://github.com/nodejs/node/pull/61590 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
42 lines
1.9 KiB
JavaScript
42 lines
1.9 KiB
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('sourcemaps output', { concurrency: !process.env.TEST_PARALLEL }, () => {
|
|
const defaultTransform = snapshot
|
|
.transform(
|
|
snapshot.basicTransform,
|
|
snapshot.transformProjectRoot(),
|
|
snapshot.replaceInternalStackTrace,
|
|
);
|
|
|
|
const tests = [
|
|
{ name: 'source-map/output/source_map_assert_source_line.ts' },
|
|
{ name: 'source-map/output/source_map_disabled_by_api.js' },
|
|
{ name: 'source-map/output/source_map_disabled_by_process_api.js' },
|
|
{ name: 'source-map/output/source_map_enabled_by_api.js' },
|
|
{ name: 'source-map/output/source_map_enabled_by_api_node_modules.js' },
|
|
{ name: 'source-map/output/source_map_enabled_by_process_api.js' },
|
|
{ name: 'source-map/output/source_map_enclosing_function.js' },
|
|
{ name: 'source-map/output/source_map_eval.js' },
|
|
{ name: 'source-map/output/source_map_no_source_file.js' },
|
|
{ name: 'source-map/output/source_map_prepare_stack_trace.js' },
|
|
{ name: 'source-map/output/source_map_reference_error_tabs.js' },
|
|
{ name: 'source-map/output/source_map_sourcemapping_url_string.js' },
|
|
{ name: 'source-map/output/source_map_throw_async_stack_trace.mjs' },
|
|
{ name: 'source-map/output/source_map_throw_catch.js' },
|
|
{ name: 'source-map/output/source_map_throw_class_method.js' },
|
|
{ name: 'source-map/output/source_map_throw_construct.mjs' },
|
|
{ name: 'source-map/output/source_map_throw_first_tick.js' },
|
|
{ name: 'source-map/output/source_map_throw_icu.js' },
|
|
{ name: 'source-map/output/source_map_throw_set_immediate.js' },
|
|
];
|
|
for (const { name } of tests) {
|
|
const skip = name.endsWith('.ts') && !process.config.variables.node_use_amaro;
|
|
it(name, { skip }, async () => {
|
|
await snapshot.spawnAndAssert(fixtures.path(name), defaultTransform);
|
|
});
|
|
}
|
|
});
|