Skip to content
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

RADFISH - 263 Remove references to Jest since we are using Vitest #167

Merged
merged 1 commit into from
Aug 30, 2024
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
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
- [Testing mocks](#testing-mocks)
- [Pattern 3 Browser integration testing (In progress)](#pattern-3-browser-integration-testing-in-progress)
- [Pattern 4 Accessibility Testing (In progress)](#pattern-4-accessibility-testing-in-progress)
- [Additional Jest Configuration](#additional-jest-configuration)
- [508 Compliance](#508-compliance)
- [Guide to Testing Section 508 Compliance in a React Project](#guide-to-testing-section-508-compliance-in-a-react-project)
- [1. Introduction to Section 508 Compliance](#1-introduction-to-section-508-compliance)
Expand Down Expand Up @@ -1004,25 +1003,25 @@ Here, we are importing the actual `"react-router-dom"` dependency, and then over

## Pattern 3 Browser integration testing (In progress)

Browser testing involves testing the application in a web browser environment. Tools like [Puppeteer](https://pptr.dev/) can be used alongside Jest.
Browser testing involves testing the application in a web browser environment. Tools like [Puppeteer](https://pptr.dev/) can be used alongside Vitest.

```jsx
const puppeteer = require("puppeteer");

it("should display the homepage", async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("http://localhost:3000");
await expect(page.title()).resolves.toMatch("Home Page");
await browser.close();
});
```
import { test, expect } from 'vitest';
import puppeteer from 'puppeteer';

## Pattern 4 Accessibility Testing (In progress)
test('should display the homepage', async () => {
const browser = await puppeteer.launch(); // Launch the browser
const page = await browser.newPage(); // Open a new page
await page.goto('http://localhost:3000'); // Navigate to your app's URL

### Additional Jest Configuration
// Verify the page title
const title = await page.title();
expect(title).toBe('Home Page');

Jest and React Testing Library is included in the RADFish framework by default. Modifying the Jest test configuration can be configured in the `jest.config.js` file. Please see the official Jest docs for the latest configuration options: https://jestjs.io/docs/configuration.
await browser.close(); // Close the browser
});

```

### 508 Compliance

Expand Down
Loading