Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Dec 18, 2024
1 parent 6c454ac commit 25c255b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ module.exports = defineConfig({
DATASOURCE_MANAGEMENT_ENABLED: false,
ML_COMMONS_DASHBOARDS_ENABLED: true,
WAIT_FOR_LOADER_BUFFER_MS: 0,
codeCoverage: {
url: 'http://localhost:5601/__coverage__',
},
},
e2e: {
baseUrl: 'http://localhost:5601',
Expand Down
6 changes: 6 additions & 0 deletions src/core/server/http/http_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ export class HttpServer {
}
}

// @ts-expect-error
if (global.__coverage__) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('@cypress/code-coverage/middleware/hapi')(this.server);
}

await this.server.start();
const serverPath =
this.config && this.config.rewriteBasePath && this.config.basePath !== undefined
Expand Down

0 comments on commit 25c255b

Please sign in to comment.