mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-19 19:49:36 +08:00
Hey! I made the following changes: - Replaced Jest by the new Playwright test-runner - Disabled the Jest linting rules for the Playwright e2e tests - Rewrote the tests to the new test-runner - Adjusted `Link.test.ts` which should be less flaky - The tests run now across all three browsers: Chromium, Firefox, and WebKit See here for reference about the new test-runner: https://playwright.dev/docs/test-intro I extracted a fix for Netlify in #9668. Let me know if you have any questions.
15 lines
354 B
TypeScript
15 lines
354 B
TypeScript
import { expect, test as it } from '@playwright/test';
|
|
import cheerio from 'cheerio';
|
|
import fetch from 'node-fetch';
|
|
|
|
const server = 'http://localhost:3275';
|
|
|
|
it('renders the home page', async () => {
|
|
const res = await fetch(server);
|
|
const html = await res.text();
|
|
|
|
const $ = cheerio.load(html);
|
|
|
|
expect($('title').text()).toBe('Examples');
|
|
});
|