Skip to content

test: verify that there are no errors on the website #6365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions packages/website/tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -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",
]);
});
});