Skip to content

Commit 1cfc6ec

Browse files
committed
tests/routes/keyword: Migrate from mirage to @crates-io/msw
1 parent 32d9061 commit 1cfc6ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/routes/keyword-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { currentURL } from '@ember/test-helpers';
22
import { module, test } from 'qunit';
33

4+
import { http, HttpResponse } from 'msw';
5+
46
import { setupApplicationTest } from 'crates-io/tests/helpers';
57

68
import { visit } from '../helpers/visit-ignoring-abort';
79

810
module('Route | keyword', function (hooks) {
9-
setupApplicationTest(hooks);
11+
setupApplicationTest(hooks, { msw: true });
1012

1113
test('shows an empty list if the keyword does not exist on the server', async function (assert) {
1214
await visit('/keywords/foo');
@@ -15,7 +17,8 @@ module('Route | keyword', function (hooks) {
1517
});
1618

1719
test('server error causes the error page to be shown', async function (assert) {
18-
this.server.get('/api/v1/crates', {}, 500);
20+
let error = HttpResponse.json({}, { status: 500 });
21+
this.worker.use(http.get('/api/v1/crates', () => error));
1922

2023
await visit('/keywords/foo');
2124
assert.strictEqual(currentURL(), '/keywords/foo');

0 commit comments

Comments
 (0)