Skip to content

Commit 4eaf3db

Browse files
committed
e2e/routes/keyword: Migrate from mirage to @crates-io/msw
1 parent ac446e5 commit 4eaf3db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

e2e/routes/keyword.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { test, expect } from '@/e2e/helper';
1+
import { expect, test } from '@/e2e/helper';
2+
import { http, HttpResponse } from 'msw';
23

34
test.describe('Route | keyword', { tag: '@routes' }, () => {
45
test('shows an empty list if the keyword does not exist on the server', async ({ page }) => {
@@ -7,10 +8,9 @@ test.describe('Route | keyword', { tag: '@routes' }, () => {
78
await expect(page.locator('[data-test-crate-row]')).toHaveCount(0);
89
});
910

10-
test('server error causes the error page to be shown', async ({ page, mirage }) => {
11-
await mirage.addHook(server => {
12-
server.get('/api/v1/crates', {}, 500);
13-
});
11+
test('server error causes the error page to be shown', async ({ page, msw }) => {
12+
let error = HttpResponse.json({}, { status: 500 });
13+
msw.worker.use(http.get('/api/v1/crates', () => error));
1414

1515
await page.goto('/keywords/foo');
1616
await expect(page).toHaveURL('/keywords/foo');

0 commit comments

Comments
 (0)