Skip to content

Remove msw option from setupApplicationTest() fn #10969

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

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests/acceptance/404-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import percySnapshot from '@percy/ember';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | 404', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('/unknown-route shows a 404 page', async function (assert) {
await visit('/unknown-route');
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/api-token-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | api-tokens', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let user = context.db.user.create({
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/categories-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | categories', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('listing categories', async function (assert) {
this.owner.lookup('service:intl').locale = 'en';
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crate-deletion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | crate deletion', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('happy path', async function (assert) {
let user = this.db.user.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crate-dependencies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import axeConfig from '../axe-config';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | crate dependencies page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows the lists of dependencies', async function (assert) {
loadFixtures(this.db);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crate-following-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { http, HttpResponse } from 'msw';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | Crate following', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context, { loggedIn = true, following = false } = {}) {
let { db } = context;
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crate-navtabs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TAB_REV_DEPS = '[data-test-rev-deps-tab] a';
const TAB_SETTINGS = '[data-test-settings-tab] a';

module('Acceptance | crate navigation tabs', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('basic navigation between tabs works as expected', async function (assert) {
let crate = this.db.crate.create({ name: 'nanomsg' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import axeConfig from '../axe-config';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | crate page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('visiting a crate page from the front page', async function (assert) {
let crate = this.db.crate.create({ name: 'nanomsg', newest_version: '0.6.1' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/crates-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import axeConfig from '../axe-config';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | crates page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

// should match the default set in the crates controller
const per_page = 50;
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/dashboard-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | Dashboard', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows "page requires authentication" error when not logged in', async function (assert) {
await visit('/dashboard');
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/dev-mode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (s.has('devmode')) {
* @link http://localhost:4200/tests/?notrycatch&devmode&filter=Development%20Mode
*/
module('Development Mode', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('authenticated', async function () {
let user = this.db.user.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/email-change-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | Email Change', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('happy path', async function (assert) {
let user = this.db.user.create({ email: '[email protected]' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/email-confirmation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | Email Confirmation', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('unauthenticated happy path', async function (assert) {
let user = this.db.user.create({ emailVerificationToken: 'badc0ffee' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/front-page-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | front page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('visiting /', async function (assert) {
this.owner.lookup('service:intl').locale = 'en';
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/invites-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | /me/pending-invites', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let inviter = context.db.user.create({ name: 'janed' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/keyword-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | keywords', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('keyword/:keyword_id index default sort is recent-downloads', async function (assert) {
this.db.keyword.create({ keyword: 'network' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/login-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { http, HttpResponse } from 'msw';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | Login', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);
setupWindowMock(hooks);

test('successful login', async function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/logout-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { setupWindowMock } from 'ember-window-mock/test-support';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | Logout', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);
setupWindowMock(hooks);

test('successful logout', async function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/publish-notifications-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { http, HttpResponse } from 'msw';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | publish notifications', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('unsubscribe and resubscribe', async function (assert) {
let user = this.db.user.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/read-only-mode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { AjaxError } from '../../utils/ajax';

module('Acceptance | Read-only Mode', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('notification is not shown for read-write mode', async function (assert) {
await visit('/');
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/readme-rendering-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ graph TD;
`;

module('Acceptance | README rendering', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('it works', async function (assert) {
let crate = this.db.crate.create({ name: 'serde' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/reverse-dependencies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | /crates/:crate_id/reverse_dependencies', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare({ db }) {
let foo = db.crate.create({ name: 'foo' });
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | search', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('searching for "rust"', async function (assert) {
loadFixtures(this.db);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/settings/add-owner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { module, test } from 'qunit';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | Settings | Add Owner', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let { db } = context;
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/settings/remove-owner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { http, HttpResponse } from 'msw';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | Settings | Remove Owner', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let { db } = context;
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/settings/settings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../../axe-config';

module('Acceptance | Settings', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let { db } = context;
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/sudo-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | sudo', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context, isAdmin) {
const user = context.db.user.create({
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/support-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import axeConfig from '../axe-config';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | support', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows an inquire list', async function (assert) {
await visit('/support');
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/team-page-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | team page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('has team organization display', async function (assert) {
loadFixtures(this.db);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/token-invites-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Acceptance | /accept-invite/:token', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('visiting to /accept-invite shows 404 page', async function (assert) {
await visit('/accept-invite');
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/user-page-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import axeConfig from '../axe-config';

module('Acceptance | user page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('has user display', async function (assert) {
loadFixtures(this.db);
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/versions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import percySnapshot from '@percy/ember';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Acceptance | crate versions page', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('show versions sorted by date', async function (assert) {
let crate = this.db.crate.create({ name: 'nanomsg' });
Expand Down
2 changes: 1 addition & 1 deletion tests/bugs/2329-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Bug #2329', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);
setupWindowMock(hooks);

test('is fixed', async function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bugs/4506-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Bug #4506', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let { db } = context;
Expand Down
7 changes: 1 addition & 6 deletions tests/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ export { setupTest, setupRenderingTest } from 'ember-qunit';

// see http://emberjs.github.io/rfcs/0637-customizable-test-setups.html
export function setupApplicationTest(hooks, options = {}) {
let { msw } = options;

upstreamSetupApplicationTest(hooks, options);

if (msw) {
setupMSW(hooks);
}

setupMSW(hooks);
setupSentryMock(hooks);
setupAppTestDataAttr(hooks);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/category-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Route | category', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test("shows an error message if the category can't be found", async function (assert) {
await visit('/categories/foo');
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/delete-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../../helpers/visit-ignoring-abort';

module('Route: crate.delete', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
let user = context.db.user.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/range-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../../helpers/visit-ignoring-abort';

module('Route | crate.range', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('happy path', async function (assert) {
let crate = this.db.crate.create({ name: 'foo' });
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/settings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../../helpers/visit-ignoring-abort';

module('Route | crate.settings', hooks => {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

function prepare(context) {
const user = context.db.user.create();
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/version/crate-links-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { module, test } from 'qunit';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Route | crate.version | crate links', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows all external crate links', async function (assert) {
let crate = this.db.crate.create({
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/version/docs-link-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { http, HttpResponse } from 'msw';
import { setupApplicationTest } from 'crates-io/tests/helpers';

module('Route | crate.version | docs link', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows regular documentation link', async function (assert) {
let crate = this.db.crate.create({ name: 'foo', documentation: 'https://foo.io/docs' });
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/crate/version/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../../../helpers/visit-ignoring-abort';

module('Route | crate.version | model() hook', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

module('with explicit version number in the URL', function () {
test('shows yanked versions', async function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/routes/keyword-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { setupApplicationTest } from 'crates-io/tests/helpers';
import { visit } from '../helpers/visit-ignoring-abort';

module('Route | keyword', function (hooks) {
setupApplicationTest(hooks, { msw: true });
setupApplicationTest(hooks);

test('shows an empty list if the keyword does not exist on the server', async function (assert) {
await visit('/keywords/foo');
Expand Down
Loading
Loading