'use strict' ; import { prepareTestApplication , testClear } from '../../Util' ; import { Application , Agent } from 'egg' ; import { CIPlatform } from '../../../app/basic/DataTypes' ; describe ( 'AppCIManager' , ( ) => { let app ; let agent ; beforeEach ( async ( ) => { ( { app , agent } = await prepareTestApplication ( ) ) ; } ) ; afterEach ( ( ) => { testClear ( app , agent ) ; } ) ; describe ( 'runJenkins()' , ( ) => { it ( 'should not trigger build() if jobName or pullNum or config is null' , async ( ) => { await app . ciManager . runJenkins ( undefined as any , undefined as any , undefined as any ) ; await app . ciManager . runJenkins ( null as any , null as any , null as any ) ; await app . ciManager . runJenkins ( '' as any , '' as any , '' as any ) ; } ) ; it ( 'should be error if jobName or config is incurrect' , async ( ) => { await app . ciManager . runJenkins ( 'a' , 'a' , { name : '' , platform : CIPlatform . Jenkins , endpoint : 'a' , user : 'a' , token : 'a' , repoToJobMap : null as any , timeout : 10 , } ) ; } ) ; } ) ; } ) ;