Skip to content

Commit d4243ba

Browse files
committed
tests/routes/team: Migrate from mirage to @crates-io/msw
1 parent 3b96929 commit d4243ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/routes/team-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 | team', function (hooks) {
9-
setupApplicationTest(hooks);
11+
setupApplicationTest(hooks, { msw: true });
1012

1113
test("shows an error message if the user can't be found", async function (assert) {
1214
await visit('/teams/foo');
@@ -18,7 +20,8 @@ module('Route | team', function (hooks) {
1820
});
1921

2022
test('server error causes the error page to be shown', async function (assert) {
21-
this.server.get('/api/v1/teams/:id', {}, 500);
23+
let error = HttpResponse.json({}, { status: 500 });
24+
this.worker.use(http.get('/api/v1/teams/:id', () => error));
2225

2326
await visit('/teams/foo');
2427
assert.strictEqual(currentURL(), '/teams/foo');

0 commit comments

Comments
 (0)