1- import { describe , expect , it , beforeEach , afterEach } from "./suite.ts" ;
1+ import { afterEach , beforeEach , describe , expect , it } from "./suite.ts" ;
22
33describe ( "CLI smoke test" , ( ) => {
44 let process : Deno . Process ;
55
66 beforeEach ( ( ) => {
77 process = Deno . run ( {
8- cmd : [ "./graphgen" , "--port" , "8900" , "--factory" , "example/factory.ts" ]
9- } )
8+ cmd : [ "./graphgen" , "--port" , "8900" , "--factory" , "example/factory.ts" ] ,
9+ } ) ;
1010 } ) ;
1111
1212 afterEach ( async ( ) => {
@@ -15,15 +15,18 @@ describe("CLI smoke test", () => {
1515
1616 it ( "can start up and we can fetch HTML from it" , async ( ) => {
1717 await eventually ( async ( ) => {
18- let response = await fetch ( ' http://localhost:8900' ) ;
18+ let response = await fetch ( " http://localhost:8900" ) ;
1919 expect ( response . ok ) . toEqual ( true ) ;
2020 let body = await response . text ( ) ;
2121 expect ( body ) . toMatch ( / d i v i d = " m a i n " / ) ;
2222 } , 10000 ) ;
23- } )
23+ } ) ;
2424} ) ;
2525
26- async function eventually ( assertion : ( ) => Promise < void > , timeout : number ) : Promise < void > {
26+ async function eventually (
27+ assertion : ( ) => Promise < void > ,
28+ timeout : number ,
29+ ) : Promise < void > {
2730 let lastError : Error | null = null ;
2831 let done = false ;
2932 let timeoutId = null ;
@@ -36,11 +39,14 @@ async function eventually(assertion: () => Promise<void>, timeout: number): Prom
3639 }
3740 }
3841 }
39-
42+
4043 try {
4144 return await Promise . race ( [
4245 new Promise < void > ( ( _ , reject ) => {
43- timeoutId = setTimeout ( ( ) => reject ( lastError ?? new Error ( 'timeout' ) ) , timeout ) ;
46+ timeoutId = setTimeout (
47+ ( ) => reject ( lastError ?? new Error ( "timeout" ) ) ,
48+ timeout ,
49+ ) ;
4450 } ) ,
4551 runAssertion ( ) ,
4652 ] ) ;
0 commit comments