diff --git a/src/github-apps/tests/rendering.js b/src/github-apps/tests/rendering.js index 5df8fefa46..d68b9b21db 100644 --- a/src/github-apps/tests/rendering.js +++ b/src/github-apps/tests/rendering.js @@ -8,10 +8,9 @@ import { isApiVersioned, allVersions } from '../../../lib/all-versions.js' describe('REST references docs', () => { jest.setTimeout(3 * 60 * 1000) - // Checks every version of the - // /rest/overview/endpoints-available-for-github-apps page - // and ensures that all sections in the openapi schema - // are present in the page. + // This test ensures that the page component and the Markdown file are + // in sync. It also checks that all expected items are present. + // For every version of /rest/overview/endpoints-available-for-github-apps test('loads operations enabled for GitHub Apps', async () => { const flatMapping = getFlatMappingWithCalendarDates() diff --git a/src/rest/tests/rendering.js b/src/rest/tests/rendering.js index 311984b2a3..a0b296f992 100644 --- a/src/rest/tests/rendering.js +++ b/src/rest/tests/rendering.js @@ -9,7 +9,8 @@ import { getDiffOpenAPIContentRest } from '../scripts/test-open-api-schema.js' describe('REST references docs', () => { jest.setTimeout(3 * 60 * 1000) - // Checks that every version of the /rest/checks + // This test ensures that the page component and the Markdown file are + // in sync. It checks that every version of the /rest/checks // page has every operation defined in the openapi schema. test('loads schema data for all versions', async () => { for (const version in allVersions) { diff --git a/src/webhooks/tests/rendering.js b/src/webhooks/tests/rendering.js index 047b96cf31..bc419d1b31 100644 --- a/src/webhooks/tests/rendering.js +++ b/src/webhooks/tests/rendering.js @@ -1,4 +1,4 @@ -import { jest } from '@jest/globals' +import { expect, jest } from '@jest/globals' import { getDOM } from '../../../tests/helpers/e2etest.js' import { allVersions } from '../../../lib/all-versions.js' import { getWebhooks } from '../lib/index.js' @@ -6,6 +6,8 @@ import { getWebhooks } from '../lib/index.js' describe('webhooks events and payloads', () => { jest.setTimeout(300 * 1000) + // This test ensures that the page component and the Markdown file are + // in sync. It also checks that all expected items are present. test('loads webhook schema data for all versions', async () => { for (const version in allVersions) { const webhooks = await getWebhooks(version) @@ -16,11 +18,10 @@ describe('webhooks events and payloads', () => { .map((i, h2) => $(h2).attr('id')) .get() - webhookNames.forEach((webhookName) => { - if (!domH2Ids.includes(webhookName)) { - throw new Error(`Webhook '${webhookName}' not on the ${versionedWebhooksPage} page`) - } - }) + const everyWebhookEventPresent = webhookNames.every((webhookName) => + domH2Ids.includes(webhookName) + ) + expect(everyWebhookEventPresent).toBe(true) } })