@@ -2,90 +2,22 @@ import { assert, assertEquals, assertStringIncludes } from "jsr:@std/assert";
22
33Deno . test ( "routing" , async ( ) => {
44 {
5- const { Bench } = await import ( "http://localhost:8080/pr/tinybench@a832a55 " ) ;
6- assertEquals ( typeof Bench , "function" ) ;
5+ const { mount } = await import ( "http://localhost:8080/pkg.pr.new/sveltejs/svelte@main " ) ;
6+ assertEquals ( typeof mount , "function" ) ;
77 }
88 {
9- const { Bench } = await import ( "http://localhost:8080/pr/tinylibs/tinybench@a832a55 " ) ;
10- assertEquals ( typeof Bench , "function" ) ;
9+ const { mount } = await import ( "http://localhost:8080/pr/sveltejs/svelte@main " ) ;
10+ assertEquals ( typeof mount , "function" ) ;
1111 }
12- {
13- const { Bench } = await import ( "http://localhost:8080/pr/tinylibs/tinybench/tinybench@a832a55" ) ;
14- assertEquals ( typeof Bench , "function" ) ;
15- }
16- {
17- const { Bench } = await import ( "http://localhost:8080/pkg.pr.new/tinybench@a832a55" ) ;
18- assertEquals ( typeof Bench , "function" ) ;
19- }
20- {
21- const { proxy } = await import ( "http://localhost:8080/pr/valtio@main" ) ;
22- assertEquals ( typeof proxy , "function" ) ;
23- }
24- // {
25- // const { proxy } = await import("http://localhost:8080/pr/valtio@e21edb3");
26- // assertEquals(typeof proxy, "function");
27- // }
28- // {
29- // const { proxy } = await import("http://localhost:8080/pr/pmndrs/valtio@e21edb3");
30- // assertEquals(typeof proxy, "function");
31- // }
32- // {
33- // const { proxy } = await import("http://localhost:8080/pr/pmndrs/valtio/valtio@e21edb3");
34- // assertEquals(typeof proxy, "function");
35- // }
36- {
37- const { defineComponent } = await import ( "http://localhost:8080/pr/vuejs/vue-vapor/@vue/runtime-dom@3f6ce96" ) ;
38- assertEquals ( typeof defineComponent , "function" ) ;
39- }
40- } ) ;
41-
42- Deno . test ( "module" , async ( ) => {
43- const res = await fetch ( "http://localhost:8080/pr/tinybench@a832a55" , { headers : { "user-agent" : "i'm a browser" } } ) ;
44- assertEquals ( res . status , 200 ) ;
45- assertEquals ( res . headers . get ( "content-type" ) , "application/javascript; charset=utf-8" ) ;
46- assertEquals ( res . headers . get ( "cache-control" ) , "public, max-age=31536000, immutable" ) ;
47- assertEquals ( res . headers . get ( "x-typescript-types" ) , "http://localhost:8080/pr/tinybench@a832a55/dist/index.d.ts" ) ;
48- const text = await res . text ( ) ;
49- assertStringIncludes ( text , "/es2022/tinybench.mjs" ) ;
50- } ) ;
51-
52- Deno . test ( "dts" , async ( ) => {
53- const res = await fetch ( "http://localhost:8080/pr/tinybench@a832a55/dist/index.d.ts" ) ;
54- assertEquals ( res . status , 200 ) ;
55- assertEquals ( res . headers . get ( "content-type" ) , "application/typescript; charset=utf-8" ) ;
56- assertEquals ( res . headers . get ( "cache-control" ) , "public, max-age=31536000, immutable" ) ;
57- const text = await res . text ( ) ;
58- assertStringIncludes ( text , "declare class Bench extends EventTarget {" ) ;
59- } ) ;
60-
61- Deno . test ( "raw files" , async ( ) => {
62- const { name } = await fetch ( "http://localhost:8080/pr/tinylibs/tinybench/tinybench@a832a55/package.json" ) . then ( ( res ) => res . json ( ) ) ;
63- assertEquals ( name , "tinybench" ) ;
64-
65- const res = await fetch ( "http://localhost:8080/pr/@rolldown/browser@main?raw" , { headers : { "user-agent" : "i'm a browser" } } ) ;
66- assert ( res . redirected ) ;
67- assertEquals ( res . status , 200 ) ;
68- assertEquals ( res . headers . get ( "content-type" ) , "application/javascript; charset=utf-8" ) ;
69- assertEquals ( res . headers . get ( "cache-control" ) , "public, max-age=31536000, immutable" ) ;
70- const code = await res . text ( ) ;
71- assertStringIncludes ( code , "build" ) ;
7212} ) ;
7313
7414Deno . test ( "resolve branch to commit hash" , async ( ) => {
75- const res = await fetch ( "http://localhost:8080/pr/@rolldown/browser @main" , { headers : { "user-agent" : "i'm a browser" } } ) ;
15+ const res = await fetch ( "http://localhost:8080/pr/sveltejs/svelte @main" , { headers : { "user-agent" : "i'm a browser" } } ) ;
7616 assert ( ! res . redirected ) ;
7717 assertEquals ( res . status , 200 ) ;
7818 assertEquals ( res . headers . get ( "content-type" ) , "application/javascript; charset=utf-8" ) ;
7919 assertEquals ( res . headers . get ( "cache-control" ) , "public, max-age=600" ) ;
8020 const code = await res . text ( ) ;
81- assert ( / @ r o l l d o w n \/ b r o w s e r @ [ \d a - f ] { 7 } / . test ( code ) ) ;
21+ assert ( / s v e l t e j s \/ s v e l t e @ [ \d a - f ] { 7 } / . test ( code ) ) ;
8222} ) ;
8323
84- Deno . test ( "as a dependency" , async ( ) => {
85- const res = await fetch ( "http://localhost:8080/pr/vuejs/vue-vapor/vue@3f6ce96" , { headers : { "user-agent" : "i'm a browser" } } ) ;
86- assertEquals ( res . status , 200 ) ;
87- assertEquals ( res . headers . get ( "content-type" ) , "application/javascript; charset=utf-8" ) ;
88- assertEquals ( res . headers . get ( "cache-control" ) , "public, max-age=31536000, immutable" ) ;
89- const code = await res . text ( ) ;
90- assertStringIncludes ( code , 'import "/pr/vuejs/vue-vapor/@vue/runtime-dom@3f6ce96/es2022/runtime-dom.mjs"' ) ;
91- } ) ;
0 commit comments