Skip to content

Commit 689c928

Browse files
committed
test: migrate post-banner sourcemap-with-shebang to Rust (#8477)
Migrates the `post-banner/sourcemap-with-shebang` test from the Node.js fixture suite to a Rust integration test, with `visualizeSourcemap` enabled for clearer snapshot-based validation. ## Changes - Removed Node.js test files in `packages/rolldown/tests/fixtures/function/post-banner/sourcemap-with-shebang/` - Added Rust test in `crates/rolldown/tests/rolldown/function/post_banner_sourcemap_with_shebang/` with `_config.json`, `main.js`, and `artifacts.snap` - Updated `filename_with_hash` snapshot to include the new test's output files <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security)
1 parent 40852c5 commit 689c928

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"visualizeSourcemap": true,
3+
"config": {
4+
"postBanner": "/* line 1 */\n/* line 2 */",
5+
"sourcemap": "File"
6+
}
7+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
source: crates/rolldown_testing/src/integration_test.rs
3+
---
4+
# Assets
5+
6+
## main.js
7+
8+
```js
9+
#!/usr/bin/env node
10+
/* line 1 */
11+
/* line 2 */
12+
//#region main.js
13+
console.log("hello");
14+
15+
//#endregion
16+
//# sourceMappingURL=main.js.map
17+
```
18+
19+
# Sourcemap Visualizer
20+
21+
```
22+
- ../main.js
23+
(1:0) "console." --> (4:0) "console."
24+
(1:8) "log(" --> (4:8) "log("
25+
(1:12) "'hello')" --> (4:12) "\"hello\")"
26+
(1:20) ";\n" --> (4:20) ";\n"
27+
```

packages/rolldown/tests/fixtures/function/post-banner/sourcemap-with-shebang/main.js renamed to crates/rolldown/tests/rolldown/function/post_banner_sourcemap_with_shebang/main.js

File renamed without changes.

crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4447,6 +4447,11 @@ expression: output
44474447
44484448
- main-!~{000}~.js => main-Df6gnIcd.js
44494449
4450+
# tests/rolldown/function/post_banner_sourcemap_with_shebang
4451+
4452+
- main-!~{000}~.js => main-CPDR1BMw.js
4453+
- main-CPDR1BMw.js.map
4454+
44504455
# tests/rolldown/function/resolve/alias_to_node_builtin_module
44514456
44524457
- main-!~{000}~.js => main-1uU37Tvb.js

packages/rolldown/tests/fixtures/function/post-banner/sourcemap-with-shebang/_config.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)