@@ -96,27 +96,42 @@ Deno.test("redirect asset URLs", async () => {
96
96
} ) ;
97
97
98
98
Deno . test ( "Fix wasm URLs with `target` segment" , async ( ) => {
99
- const res = await fetch (
100
- "http://localhost:8080/lightningcss-wasm@1.19.0/deno/lightningcss_node.wasm" ,
101
- { redirect : "manual" } ,
102
- ) ;
103
- res . body ?. cancel ( ) ;
104
- assertEquals ( res . status , 301 ) ;
105
- assertEquals (
106
- res . headers . get ( "location" ) ,
107
- "http://localhost:8080/lightningcss-wasm@1.19.0/lightningcss_node.wasm" ,
108
- ) ;
109
-
110
- const res2 = await fetch (
111
- "http://localhost:8080/esm-compiler@0.7.2/es2024/esm_compiler_bg.wasm" ,
112
- { redirect : "manual" } ,
113
- ) ;
114
- res2 . body ?. cancel ( ) ;
115
- assertEquals ( res2 . status , 301 ) ;
116
- assertEquals (
117
- res2 . headers . get ( "location" ) ,
118
- "http://localhost:8080/esm-compiler@0.7.2/pkg/esm_compiler_bg.wasm" ,
119
- ) ;
99
+ {
100
+ const res = await fetch (
101
+ "http://localhost:8080/lightningcss-wasm@1.19.0/deno/lightningcss_node.wasm" ,
102
+ { redirect : "manual" } ,
103
+ ) ;
104
+ res . body ?. cancel ( ) ;
105
+ assertEquals ( res . status , 301 ) ;
106
+ assertEquals (
107
+ res . headers . get ( "location" ) ,
108
+ "http://localhost:8080/lightningcss-wasm@1.19.0/lightningcss_node.wasm" ,
109
+ ) ;
110
+ }
111
+ {
112
+ const res = await fetch (
113
+ "http://localhost:8080/esm-compiler@0.7.2/es2024/esm_compiler_bg.wasm" ,
114
+ { redirect : "manual" } ,
115
+ ) ;
116
+ res . body ?. cancel ( ) ;
117
+ assertEquals ( res . status , 301 ) ;
118
+ assertEquals (
119
+ res . headers . get ( "location" ) ,
120
+ "http://localhost:8080/esm-compiler@0.7.2/pkg/esm_compiler_bg.wasm" ,
121
+ ) ;
122
+ }
123
+ {
124
+ const res = await fetch (
125
+ "http://localhost:8080/gh/oxc-project/oxc@7d785c3/es2022/napi/parser/parser.wasm32-wasi.wasm" ,
126
+ { redirect : "manual" } ,
127
+ ) ;
128
+ res . body ?. cancel ( ) ;
129
+ assertEquals ( res . status , 301 ) ;
130
+ assertEquals (
131
+ res . headers . get ( "location" ) ,
132
+ "http://localhost:8080/gh/oxc-project/oxc@7d785c3/napi/parser/parser.wasm32-wasi.wasm" ,
133
+ ) ;
134
+ }
120
135
} ) ;
121
136
122
137
Deno . test ( "Fix json URLs with `target` segment" , async ( ) => {
0 commit comments