Skip to content

Commit

Permalink
test: verify that there are no errors on the website (#6365)
Browse files Browse the repository at this point in the history
closes: #6354
  • Loading branch information
Jefiozie committed Jan 25, 2023
1 parent 67706e7 commit 033e87c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions packages/website/tests/index.spec.ts
@@ -1,7 +1,22 @@
import AxeBuilder from '@axe-core/playwright';
import { test } from '@playwright/test';
import { expect, test } from '@playwright/test';

test('Index', async ({ page }) => {
await page.goto('/');
await new AxeBuilder({ page }).analyze();
test.describe('Website', () => {
test('Axe', async ({ page }) => {
await page.goto('/');
await new AxeBuilder({ page }).analyze();
});

test('should have no errors', async ({ page }) => {
const errorMessages: string[] = [];
page.on('console', msg => {
if (['error', 'warning'].includes(msg.type())) {
errorMessages.push(`[${msg.type()}] ${msg.text()}`);
}
});
await page.goto('/');
expect(errorMessages).toStrictEqual([
"[error] Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot",
]);
});
});

0 comments on commit 033e87c

Please sign in to comment.