Skip to content

Commit

Permalink
test: add app chunk test
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 8, 2024
1 parent f97f165 commit 70ee29f
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"config": {
"format": "app"
},
"expectExecuted": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
source: crates/rolldown_testing/src/integration_test.rs
snapshot_kind: text
---
# Assets

## dep.js

```js
var __rolldown_modules = {
"dep.js": function(__rolldown_runtime) {
//#region dep.js
__rolldown_runtime.__toCommonJS(__rolldown_runtime.exports);
__rolldown_runtime.__export(__rolldown_runtime.exports, { default: () => dep_default });
var dep_default = "[dep ok]";
//#endregion
},
};
```
## main.js

```js
var __rolldown_modules = {
"main.js": function(__rolldown_runtime) {
//#region main.js
__rolldown_runtime.__toCommonJS(__rolldown_runtime.exports);
__rolldown_runtime.__export(__rolldown_runtime.exports, { default: () => main_default });
var main_default = () => import("./dep.js");
//#endregion
},
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "[dep ok]"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => import("./dep.js")
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"config": {
"format": "app",
"input": [
{
"import": "./main1.js",
"name": "main1"
},
{
"import": "./main2.js",
"name": "main2"
}
]
},
"expectExecuted": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
source: crates/rolldown_testing/src/integration_test.rs
snapshot_kind: text
---
# Assets

## dep.js

```js
var __rolldown_modules = {
"dep.js": function(__rolldown_runtime) {
//#region dep.js
__rolldown_runtime.__toCommonJS(__rolldown_runtime.exports);
__rolldown_runtime.__export(__rolldown_runtime.exports, { default: () => dep_default });
var dep_default = "[dep ok]";
//#endregion
},
};
```
## main1.js

```js
var __rolldown_modules = {
"main1.js": function(__rolldown_runtime) {
//#region main1.js
__rolldown_runtime.__toCommonJS(__rolldown_runtime.exports);
__rolldown_runtime.__export(__rolldown_runtime.exports, { default: () => main1_default });
var dep_exports = __rolldown_runtime.require("dep.js");
var main1_default = "main1: " + dep_exports.default;
//#endregion
},
};
```
## main2.js

```js
var __rolldown_modules = {
"main2.js": function(__rolldown_runtime) {
//#region main2.js
__rolldown_runtime.__toCommonJS(__rolldown_runtime.exports);
__rolldown_runtime.__export(__rolldown_runtime.exports, { default: () => main2_default });
var dep_exports = __rolldown_runtime.require("dep.js");
var main2_default = "main2: " + dep_exports.default;
//#endregion
},
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "[dep ok]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import dep from "./dep.js"
export default "main1: " + dep;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import dep from "./dep.js"
export default "main2: " + dep;
Original file line number Diff line number Diff line change
Expand Up @@ -4125,6 +4125,11 @@ snapshot_kind: text
- out.js => out.js
- out.css
# tests/rolldown/function/format/app/dynamic-import-chunk
- main-!~{000}~.js => main-CLbdS1rw.js
- dep-!~{001}~.js => dep-CpkzZlrt.js
# tests/rolldown/function/format/app/export-all
- main-!~{000}~.js => main-BdghrDco.js
Expand Down Expand Up @@ -4163,6 +4168,12 @@ snapshot_kind: text
- main-!~{000}~.js => main-C1Zl5Znc.js
# tests/rolldown/function/format/app/shared-chunk
- main1-!~{000}~.js => main1-R3nOeIoa.js
- main2-!~{001}~.js => main2-BbKbhREb.js
- dep-!~{002}~.js => dep-Bs9a6pBX.js
# tests/rolldown/function/format/cjs/conflict_exports_key
- main-!~{000}~.js => main-BJs_Uc9B.js
Expand Down

0 comments on commit 70ee29f

Please sign in to comment.