@@ -24,36 +24,41 @@ describe("Pages _worker.js/ directory", () => {
2424 "--r2=R2_REF=other_r2" ,
2525 ]
2626 ) ;
27- await expect (
28- fetch ( `http://${ ip } :${ port } /` ) . then ( ( resp ) => resp . text ( ) )
29- ) . resolves . toContain ( "Hello, world!" ) ;
30- await expect (
31- fetch ( `http://${ ip } :${ port } /wasm` ) . then ( ( resp ) => resp . text ( ) )
32- ) . resolves . toContain ( "3" ) ;
33- await expect (
34- fetch ( `http://${ ip } :${ port } /static-js` ) . then ( ( resp ) => resp . text ( ) )
35- ) . resolves . toEqual ( "static import text (via js): 'js static'" ) ;
36- await expect (
37- fetch ( `http://${ ip } :${ port } /static-mjs` ) . then ( ( resp ) => resp . text ( ) )
38- ) . resolves . toEqual ( "static import text (via mjs): 'mjs static'" ) ;
39- await expect (
40- fetch ( `http://${ ip } :${ port } /other-script.js` ) . then ( ( resp ) => resp . text ( ) )
41- ) . resolves . toContain ( "other-script-test" ) ;
42- await expect (
43- fetch ( `http://${ ip } :${ port } /other-other-script.mjs` ) . then ( ( resp ) =>
44- resp . text ( )
45- )
46- ) . resolves . toContain ( "other-other-script-test" ) ;
47- await expect (
48- fetch ( `http://${ ip } :${ port } /d1` ) . then ( ( resp ) => resp . text ( ) )
49- ) . resolves . toContain ( '{"1":1}' ) ;
50- await expect (
51- fetch ( `http://${ ip } :${ port } /kv` ) . then ( ( resp ) => resp . text ( ) )
52- ) . resolves . toContain ( "saved" ) ;
53- await expect (
54- fetch ( `http://${ ip } :${ port } /r2` ) . then ( ( resp ) => resp . text ( ) )
55- ) . resolves . toContain ( "saved" ) ;
56- await stop ( ) ;
27+ try {
28+ await expect (
29+ fetch ( `http://${ ip } :${ port } /` ) . then ( ( resp ) => resp . text ( ) )
30+ ) . resolves . toContain ( "Hello, world!" ) ;
31+ await expect (
32+ fetch ( `http://${ ip } :${ port } /wasm` ) . then ( ( resp ) => resp . text ( ) )
33+ ) . resolves . toContain ( "3" ) ;
34+ await expect (
35+ fetch ( `http://${ ip } :${ port } /static-js` ) . then ( ( resp ) => resp . text ( ) )
36+ ) . resolves . toEqual ( "static import text (via js): 'js static'" ) ;
37+ await expect (
38+ fetch ( `http://${ ip } :${ port } /static-mjs` ) . then ( ( resp ) => resp . text ( ) )
39+ ) . resolves . toEqual ( "static import text (via mjs): 'mjs static'" ) ;
40+ await expect (
41+ fetch ( `http://${ ip } :${ port } /other-script.js` ) . then ( ( resp ) =>
42+ resp . text ( )
43+ )
44+ ) . resolves . toContain ( "other-script-test" ) ;
45+ await expect (
46+ fetch ( `http://${ ip } :${ port } /other-other-script.mjs` ) . then ( ( resp ) =>
47+ resp . text ( )
48+ )
49+ ) . resolves . toContain ( "other-other-script-test" ) ;
50+ await expect (
51+ fetch ( `http://${ ip } :${ port } /d1` ) . then ( ( resp ) => resp . text ( ) )
52+ ) . resolves . toContain ( '{"1":1}' ) ;
53+ await expect (
54+ fetch ( `http://${ ip } :${ port } /kv` ) . then ( ( resp ) => resp . text ( ) )
55+ ) . resolves . toContain ( "saved" ) ;
56+ await expect (
57+ fetch ( `http://${ ip } :${ port } /r2` ) . then ( ( resp ) => resp . text ( ) )
58+ ) . resolves . toContain ( "saved" ) ;
59+ } finally {
60+ await stop ( ) ;
61+ }
5762
5863 expect ( existsSync ( join ( tmpDir , "./v3/d1/D1" ) ) ) . toBeTruthy ( ) ;
5964 expect ( existsSync ( join ( tmpDir , "./v3/d1/elsewhere" ) ) ) . toBeTruthy ( ) ;
0 commit comments