Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81560c9

Browse files
committed
test: enable more esbuild tests
1 parent fadb2db commit 81560c9

9 files changed

Lines changed: 60 additions & 11 deletions

File tree

crates/rolldown/src/bundler/module_loader/normal_module_task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<'task, T: FileSystem + Default + 'static> NormalModuleTask<'task, T> {
245245
errors.merge(e);
246246
}
247247
});
248-
debug_assert!(errors.is_empty() && ret.len() == dependencies.len());
248+
debug_assert!(errors.is_empty() && ret.len() == dependencies.len(), "{:#?}", dependencies);
249249

250250
Ok(ret)
251251
}

crates/rolldown/tests/esbuild/default/.quoted_property/test.config.json

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
source: crates/rolldown/tests/common/case.rs
3+
expression: content
4+
input_file: crates/rolldown/tests/esbuild/default/await_import_inside_try
5+
---
6+
# Assets
7+
8+
## entry_js.mjs
9+
10+
```js
11+
// entry.js
12+
async function main(name) {
13+
try {
14+
return await import(name)
15+
} catch {
16+
}
17+
}
18+
main('fs')
19+
```

crates/rolldown/tests/esbuild/default/.await_import_inside_try/entry.js renamed to crates/rolldown/tests/esbuild/default/await_import_inside_try/entry.js

File renamed without changes.

crates/rolldown/tests/esbuild/default/.await_import_inside_try/test.config.json renamed to crates/rolldown/tests/esbuild/default/await_import_inside_try/test.config.json

File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
source: crates/rolldown/tests/common/case.rs
3+
expression: content
4+
input_file: crates/rolldown/tests/esbuild/default/quoted_property
5+
---
6+
# Assets
7+
8+
## entry_js.mjs
9+
10+
```js
11+
import * as ext_ns from "ext";
12+
13+
// entry.js
14+
15+
console.log(ext_ns.mustBeUnquoted, ext_ns['mustBeQuoted'])
16+
```

crates/rolldown/tests/esbuild/default/.quoted_property/entry.js renamed to crates/rolldown/tests/esbuild/default/quoted_property/entry.js

File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"input": {
3+
"input": [
4+
{
5+
"name": "entry_js",
6+
"import": "entry.js"
7+
}
8+
],
9+
"external": [
10+
"ext"
11+
]
12+
},
13+
"_comment": "Original input is invalid",
14+
"expectExecuted": false
15+
}

crates/rolldown_testing/test.config.scheme.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
"InputOptions": {
4747
"type": "object",
4848
"properties": {
49+
"external": {
50+
"type": [
51+
"array",
52+
"null"
53+
],
54+
"items": {
55+
"type": "string"
56+
}
57+
},
4958
"input": {
5059
"type": [
5160
"array",

0 commit comments

Comments
 (0)