( name: string, codeServerArgs: string[], codeServerEnv: NodeJS.ProcessEnv, fn: (codeServer: CodeServer) => void, )
| 9 | * If `includeCredentials` is `true` page requests will be authenticated. |
| 10 | */ |
| 11 | export const describe = ( |
| 12 | name: string, |
| 13 | codeServerArgs: string[], |
| 14 | codeServerEnv: NodeJS.ProcessEnv, |
| 15 | fn: (codeServer: CodeServer) => void, |
| 16 | ) => { |
| 17 | test.describe(name, () => { |
| 18 | // This will spawn on demand so nothing is necessary on before. |
| 19 | const codeServer = new CodeServer(name, codeServerArgs, codeServerEnv, undefined) |
| 20 | |
| 21 | // Kill code-server after the suite has ended. This may happen even without |
| 22 | // doing it explicitly but it seems prudent to be sure. |
| 23 | test.afterAll(async () => { |
| 24 | await codeServer.close() |
| 25 | }) |
| 26 | |
| 27 | test.use({ |
| 28 | // Makes `codeServer` and `authenticated` available to the extend call |
| 29 | // below. |
| 30 | codeServer, |
| 31 | // NOTE@jsjoeio some tests use --cert which uses a self-signed certificate |
| 32 | // without this option, those tests will fail. |
| 33 | ignoreHTTPSErrors: true, |
| 34 | }) |
| 35 | |
| 36 | fn(codeServer) |
| 37 | }) |
| 38 | } |
| 39 | |
| 40 | interface TestFixtures { |
| 41 | codeServer: CodeServer |
no test coverage detected