Skip to content

test: migrate message source map tests from Python to JS

Some JS files are detected as deleted and newly created even though they are very similar. I also mentioned the reason here https://github.com/nodejs/node/issues/47707#issuecomment-1684467535. IMHO, it is because the default similarity index for git diff is 50%.

Same for most .snapshot files ( they are also detected as deleted ), the main difference between the original .out file and the .snapshot file is .snapshot files have more details like Object.<anonymous>.

Example:

  • node/test/fixtures/source-map/output/source_map_throw_catch.snapshot
reachable
Error: an exception
    at branch (*typescript-throw.ts:18:11)
    at Object.<anonymous> (*typescript-throw.ts:24:1)
  • node/test/message/source_map_throw_catch.out
reachable
Error: an exception
    at *typescript-throw.ts:18:11*
    at *typescript-throw.ts:24:1*

Should I replace these Object.<anonymous>?

Also, https://github.com/nodejs/node/issues/47707#issuecomment-1684794901

In the latest code version, the tests for source_map_disabled_by_api.js and source_map_enabled_by_api.js are failing because of the change in the commit #46391.

Should I update the .snapshot files for them accordingly ?

Merge request reports

Loading