import { Agent } from 'egg' ; import { initWebhooks } from '../plugin/github/GitHubTestUtil' ; import { prepareTestApplication , testClear } from '../Util' ; import { MockApplication } from 'egg-mock' ; describe ( 'Docs Controller' , ( ) => { let app ; let agent ; before ( async ( ) => { ( { app , agent } = await prepareTestApplication ( ) as any ) ; await initWebhooks ( app ) ; } ) ; after ( ( ) => { testClear ( app , agent ) ; } ) ; describe ( 'GET /docs/:installationName/:owner/:repo/community.svg' , ( ) => { it ( 'should status 200' , async ( ) => { return app . httpRequest ( ) . get ( '/docs/github/owner/repo/community.svg' ) . expect ( 200 ) ; } ) ; it ( 'should status 200 but cannot get the client' , async ( ) => { return app . httpRequest ( ) . get ( '/docs/github/owner2/repo2/community.svg' ) . expect ( 200 ) . expect ( 'Client not found' ) ; } ) ; } ) ; } ) ;