From 9734c639b7ebb7fa30f272a5e2a8a0bd99691805 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Thu, 9 Jan 2025 13:59:20 +0100 Subject: [PATCH] mirage: Replace `ember-cli-mirage` with direct `miragejs` usage --- .eslintrc.js | 2 +- .github/workflows/ci.yml | 1 - config/environment.js | 2 - docs/ARCHITECTURE.md | 2 +- package.json | 5 +- pnpm-lock.yaml | 62 +------------------ tests/acceptance/front-page-test.js | 2 +- tests/acceptance/search-test.js | 2 +- tests/helpers/setup-mirage.js | 22 ++++++- {mirage => tests/mirage}/config.js | 0 .../mirage}/factories/api-token.js | 0 .../mirage}/factories/category.js | 0 .../factories/crate-owner-invitation.js | 0 .../mirage}/factories/crate-ownership.js | 0 {mirage => tests/mirage}/factories/crate.js | 0 .../mirage}/factories/dependency.js | 0 {mirage => tests/mirage}/factories/index.js | 0 {mirage => tests/mirage}/factories/keyword.js | 0 .../mirage}/factories/mirage-session.js | 0 {mirage => tests/mirage}/factories/team.js | 0 {mirage => tests/mirage}/factories/user.js | 0 .../mirage}/factories/version-download.js | 0 {mirage => tests/mirage}/factories/version.js | 0 .../mirage}/fixtures/categories.js | 0 .../mirage}/fixtures/crate-ownerships.js | 0 {mirage => tests/mirage}/fixtures/crates.js | 0 .../mirage}/fixtures/dependencies.js | 0 {mirage => tests/mirage}/fixtures/index.js | 0 {mirage => tests/mirage}/fixtures/keywords.js | 0 {mirage => tests/mirage}/fixtures/teams.js | 0 {mirage => tests/mirage}/fixtures/users.js | 0 .../mirage}/fixtures/version-downloads.js | 0 {mirage => tests/mirage}/fixtures/versions.js | 0 {mirage => tests/mirage}/models/api-token.js | 0 .../mirage}/models/category-slug.js | 0 {mirage => tests/mirage}/models/category.js | 0 .../mirage}/models/crate-owner-invitation.js | 0 .../mirage}/models/crate-ownership.js | 0 {mirage => tests/mirage}/models/crate.js | 0 {mirage => tests/mirage}/models/dependency.js | 0 {mirage => tests/mirage}/models/index.js | 0 {mirage => tests/mirage}/models/keyword.js | 0 .../mirage}/models/mirage-session.js | 0 .../mirage}/models/owned-crate.js | 0 {mirage => tests/mirage}/models/team.js | 0 {mirage => tests/mirage}/models/user.js | 0 .../mirage}/models/version-download.js | 0 {mirage => tests/mirage}/models/version.js | 0 .../mirage}/route-handlers/-utils.js | 0 .../mirage}/route-handlers/categories.js | 0 .../mirage}/route-handlers/crates.js | 0 .../mirage}/route-handlers/docs-rs.js | 0 .../mirage}/route-handlers/index.js | 0 .../mirage}/route-handlers/invites.js | 0 .../mirage}/route-handlers/keywords.js | 0 {mirage => tests/mirage}/route-handlers/me.js | 0 .../mirage}/route-handlers/metadata.js | 0 .../mirage}/route-handlers/session.js | 0 .../mirage}/route-handlers/summary.js | 0 .../mirage}/route-handlers/teams.js | 0 .../mirage}/route-handlers/users.js | 0 .../mirage}/serializers/api-token.js | 0 .../mirage}/serializers/application.js | 0 .../mirage}/serializers/category.js | 0 .../serializers/crate-owner-invitation.js | 0 {mirage => tests/mirage}/serializers/crate.js | 0 .../mirage}/serializers/dependency.js | 0 {mirage => tests/mirage}/serializers/index.js | 0 .../mirage}/serializers/keyword.js | 0 {mirage => tests/mirage}/serializers/team.js | 0 {mirage => tests/mirage}/serializers/user.js | 0 .../mirage}/serializers/version-download.js | 0 .../mirage}/serializers/version.js | 0 .../{ => tests}/categories/get-by-id-test.js | 4 +- .../{ => tests}/categories/list-test.js | 4 +- .../{ => tests}/category-slugs/list-test.js | 4 +- .../{ => tests}/confirm/put-by-id-test.js | 4 +- .../{ => tests}/crates/add-owner-test.js | 4 +- .../mirage/{ => tests}/crates/delete-test.js | 4 +- .../{ => tests}/crates/downloads-test.js | 4 +- .../{ => tests}/crates/follow/delete-test.js | 4 +- .../{ => tests}/crates/follow/get-test.js | 4 +- .../{ => tests}/crates/follow/put-test.js | 4 +- .../{ => tests}/crates/get-by-id-test.js | 4 +- tests/mirage/{ => tests}/crates/list-test.js | 4 +- .../{ => tests}/crates/owner-team-test.js | 4 +- .../{ => tests}/crates/owner-user-test.js | 4 +- .../crates/reverse-dependencies-test.js | 4 +- .../crates/versions/authors-test.js | 4 +- .../crates/versions/dependencies-test.js | 4 +- .../crates/versions/downloads-test.js | 4 +- .../crates/versions/get-by-num-test.js | 4 +- .../{ => tests}/crates/versions/list-test.js | 4 +- .../{ => tests}/crates/versions/patch-test.js | 4 +- .../crates/versions/readme-test.js | 4 +- .../crates/versions/yank/unyank-test.js | 4 +- .../crates/versions/yank/yank-test.js | 4 +- .../{ => tests}/keywords/get-by-id-test.js | 4 +- .../mirage/{ => tests}/keywords/list-test.js | 4 +- .../me/crate-owner-invitations/list-test.js | 4 +- tests/mirage/{ => tests}/me/get-test.js | 4 +- .../{ => tests}/me/tokens/create-test.js | 4 +- .../me/tokens/delete-by-id-test.js | 4 +- .../mirage/{ => tests}/me/tokens/list-test.js | 4 +- .../{ => tests}/me/updates/list-test.js | 4 +- .../crate-owner-invitations/get-test.js | 4 +- .../private/session/delete-test.js | 4 +- tests/mirage/{ => tests}/summary-test.js | 2 +- .../{ => tests}/teams/get-by-id-test.js | 4 +- .../{ => tests}/users/get-by-id-test.js | 4 +- .../{ => tests}/users/resend-by-id-test.js | 4 +- .../{ => tests}/users/update-by-id-test.js | 4 +- {mirage => tests/mirage}/utils/session.js | 0 tests/test-helper.js | 5 ++ 114 files changed, 111 insertions(+), 148 deletions(-) rename {mirage => tests/mirage}/config.js (100%) rename {mirage => tests/mirage}/factories/api-token.js (100%) rename {mirage => tests/mirage}/factories/category.js (100%) rename {mirage => tests/mirage}/factories/crate-owner-invitation.js (100%) rename {mirage => tests/mirage}/factories/crate-ownership.js (100%) rename {mirage => tests/mirage}/factories/crate.js (100%) rename {mirage => tests/mirage}/factories/dependency.js (100%) rename {mirage => tests/mirage}/factories/index.js (100%) rename {mirage => tests/mirage}/factories/keyword.js (100%) rename {mirage => tests/mirage}/factories/mirage-session.js (100%) rename {mirage => tests/mirage}/factories/team.js (100%) rename {mirage => tests/mirage}/factories/user.js (100%) rename {mirage => tests/mirage}/factories/version-download.js (100%) rename {mirage => tests/mirage}/factories/version.js (100%) rename {mirage => tests/mirage}/fixtures/categories.js (100%) rename {mirage => tests/mirage}/fixtures/crate-ownerships.js (100%) rename {mirage => tests/mirage}/fixtures/crates.js (100%) rename {mirage => tests/mirage}/fixtures/dependencies.js (100%) rename {mirage => tests/mirage}/fixtures/index.js (100%) rename {mirage => tests/mirage}/fixtures/keywords.js (100%) rename {mirage => tests/mirage}/fixtures/teams.js (100%) rename {mirage => tests/mirage}/fixtures/users.js (100%) rename {mirage => tests/mirage}/fixtures/version-downloads.js (100%) rename {mirage => tests/mirage}/fixtures/versions.js (100%) rename {mirage => tests/mirage}/models/api-token.js (100%) rename {mirage => tests/mirage}/models/category-slug.js (100%) rename {mirage => tests/mirage}/models/category.js (100%) rename {mirage => tests/mirage}/models/crate-owner-invitation.js (100%) rename {mirage => tests/mirage}/models/crate-ownership.js (100%) rename {mirage => tests/mirage}/models/crate.js (100%) rename {mirage => tests/mirage}/models/dependency.js (100%) rename {mirage => tests/mirage}/models/index.js (100%) rename {mirage => tests/mirage}/models/keyword.js (100%) rename {mirage => tests/mirage}/models/mirage-session.js (100%) rename {mirage => tests/mirage}/models/owned-crate.js (100%) rename {mirage => tests/mirage}/models/team.js (100%) rename {mirage => tests/mirage}/models/user.js (100%) rename {mirage => tests/mirage}/models/version-download.js (100%) rename {mirage => tests/mirage}/models/version.js (100%) rename {mirage => tests/mirage}/route-handlers/-utils.js (100%) rename {mirage => tests/mirage}/route-handlers/categories.js (100%) rename {mirage => tests/mirage}/route-handlers/crates.js (100%) rename {mirage => tests/mirage}/route-handlers/docs-rs.js (100%) rename {mirage => tests/mirage}/route-handlers/index.js (100%) rename {mirage => tests/mirage}/route-handlers/invites.js (100%) rename {mirage => tests/mirage}/route-handlers/keywords.js (100%) rename {mirage => tests/mirage}/route-handlers/me.js (100%) rename {mirage => tests/mirage}/route-handlers/metadata.js (100%) rename {mirage => tests/mirage}/route-handlers/session.js (100%) rename {mirage => tests/mirage}/route-handlers/summary.js (100%) rename {mirage => tests/mirage}/route-handlers/teams.js (100%) rename {mirage => tests/mirage}/route-handlers/users.js (100%) rename {mirage => tests/mirage}/serializers/api-token.js (100%) rename {mirage => tests/mirage}/serializers/application.js (100%) rename {mirage => tests/mirage}/serializers/category.js (100%) rename {mirage => tests/mirage}/serializers/crate-owner-invitation.js (100%) rename {mirage => tests/mirage}/serializers/crate.js (100%) rename {mirage => tests/mirage}/serializers/dependency.js (100%) rename {mirage => tests/mirage}/serializers/index.js (100%) rename {mirage => tests/mirage}/serializers/keyword.js (100%) rename {mirage => tests/mirage}/serializers/team.js (100%) rename {mirage => tests/mirage}/serializers/user.js (100%) rename {mirage => tests/mirage}/serializers/version-download.js (100%) rename {mirage => tests/mirage}/serializers/version.js (100%) rename tests/mirage/{ => tests}/categories/get-by-id-test.js (94%) rename tests/mirage/{ => tests}/categories/list-test.js (96%) rename tests/mirage/{ => tests}/category-slugs/list-test.js (94%) rename tests/mirage/{ => tests}/confirm/put-by-id-test.js (93%) rename tests/mirage/{ => tests}/crates/add-owner-test.js (97%) rename tests/mirage/{ => tests}/crates/delete-test.js (93%) rename tests/mirage/{ => tests}/crates/downloads-test.js (94%) rename tests/mirage/{ => tests}/crates/follow/delete-test.js (93%) rename tests/mirage/{ => tests}/crates/follow/get-test.js (93%) rename tests/mirage/{ => tests}/crates/follow/put-test.js (92%) rename tests/mirage/{ => tests}/crates/get-by-id-test.js (98%) rename tests/mirage/{ => tests}/crates/list-test.js (98%) rename tests/mirage/{ => tests}/crates/owner-team-test.js (93%) rename tests/mirage/{ => tests}/crates/owner-user-test.js (93%) rename tests/mirage/{ => tests}/crates/reverse-dependencies-test.js (98%) rename tests/mirage/{ => tests}/crates/versions/authors-test.js (93%) rename tests/mirage/{ => tests}/crates/versions/dependencies-test.js (96%) rename tests/mirage/{ => tests}/crates/versions/downloads-test.js (95%) rename tests/mirage/{ => tests}/crates/versions/get-by-num-test.js (94%) rename tests/mirage/{ => tests}/crates/versions/list-test.js (98%) rename tests/mirage/{ => tests}/crates/versions/patch-test.js (97%) rename tests/mirage/{ => tests}/crates/versions/readme-test.js (93%) rename tests/mirage/{ => tests}/crates/versions/yank/unyank-test.js (94%) rename tests/mirage/{ => tests}/crates/versions/yank/yank-test.js (94%) rename tests/mirage/{ => tests}/keywords/get-by-id-test.js (93%) rename tests/mirage/{ => tests}/keywords/list-test.js (95%) rename tests/mirage/{ => tests}/me/crate-owner-invitations/list-test.js (96%) rename tests/mirage/{ => tests}/me/get-test.js (94%) rename tests/mirage/{ => tests}/me/tokens/create-test.js (96%) rename tests/mirage/{ => tests}/me/tokens/delete-by-id-test.js (91%) rename tests/mirage/{ => tests}/me/tokens/list-test.js (95%) rename tests/mirage/{ => tests}/me/updates/list-test.js (96%) rename tests/mirage/{ => tests}/private/crate-owner-invitations/get-test.js (98%) rename tests/mirage/{ => tests}/private/session/delete-test.js (89%) rename tests/mirage/{ => tests}/summary-test.js (99%) rename tests/mirage/{ => tests}/teams/get-by-id-test.js (90%) rename tests/mirage/{ => tests}/users/get-by-id-test.js (90%) rename tests/mirage/{ => tests}/users/resend-by-id-test.js (92%) rename tests/mirage/{ => tests}/users/update-by-id-test.js (97%) rename {mirage => tests/mirage}/utils/session.js (100%) diff --git a/.eslintrc.js b/.eslintrc.js index a0b787261f5..a8cdd391446 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -109,7 +109,7 @@ module.exports = { // mirage files { - files: ['mirage/**/*.js'], + files: ['tests/mirage/**/*.js'], rules: { // disabled because of different `.find()` meaning 'unicorn/no-array-callback-reference': 'off', diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d4e164733d..e2917fbf36d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: files_ignore: | app/** e2e/** - mirage/** public/** tests/** .eslintrc diff --git a/config/environment.js b/config/environment.js index c5c1ec61d10..0b1653e42e8 100644 --- a/config/environment.js +++ b/config/environment.js @@ -63,8 +63,6 @@ module.exports = function (environment) { if (environment === 'production') { // here you can enable a production-specific feature - delete ENV['ember-cli-mirage']; - ENV.sentry = { dsn: process.env.SENTRY_DSN_WEB, }; diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 6c2430fd891..268fd5af42b 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -51,7 +51,6 @@ These files have to do with the frontend: - `.ember-cli` - Settings for the `ember` command line interface - `ember-cli-build.js` - Contains the build specification for Broccoli - `.eslintrc.js` - Defines Javascript coding style guidelines (enforced during CI???) -- `mirage/` - A mock backend used during development and testing - `node_modules/` - npm dependencies - (ignored in `.gitignore`) - `package.json` - Defines the npm package and its dependencies - `package-lock.json` - Locks dependencies to specific versions providing consistency across @@ -59,6 +58,7 @@ These files have to do with the frontend: - `public/` - Static files that are merged into `dist/` during build - `testem.js` - Integration with Test'em Scripts - `tests/` - Frontend tests +- `tests/mirage/` - A mock backend used during development and testing - `vendor/` - frontend dependencies not distributed by npm; not currently used ## Deployment - Heroku diff --git a/package.json b/package.json index dc9233bdb92..7ec0fe69eea 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "ember-cli-head": "2.0.0", "ember-cli-htmlbars": "6.3.0", "ember-cli-inject-live-reload": "2.1.0", - "ember-cli-mirage": "3.0.4", "ember-cli-notifications": "9.1.0", "ember-click-outside": "6.1.1", "ember-concurrency": "4.0.2", @@ -98,6 +97,7 @@ "ember-event-helpers": "0.1.1", "ember-exam": "9.0.0", "ember-fetch": "8.1.2", + "ember-inflector": "5.0.2", "ember-keyboard": "9.0.1", "ember-link": "3.3.0", "ember-load-initializers": "3.0.1", @@ -142,8 +142,7 @@ "ember-get-config": "2.1.1", "ember-inflector": "5.0.2", "ember-modifier": "4.2.0", - "ember-svg-jar>cheerio": "1.0.0-rc.12", - "miragejs": "0.1.48" + "ember-svg-jar>cheerio": "1.0.0-rc.12" }, "pnpm": { "peerDependencyRules": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f700b13aebd..0b206ea9681 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,6 @@ overrides: ember-inflector: 5.0.2 ember-modifier: 4.2.0 ember-svg-jar>cheerio: 1.0.0-rc.12 - miragejs: 0.1.48 importers: @@ -151,9 +150,6 @@ importers: ember-cli-inject-live-reload: specifier: 2.1.0 version: 2.1.0 - ember-cli-mirage: - specifier: 3.0.4 - version: 3.0.4(@ember-data/model@5.3.9(ooa3zjjpg5ssichpukhgmudu7m))(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-data@5.3.9(@ember/string@3.1.1)(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(@ember/test-waiters@3.1.0)(ember-inflector@5.0.2(@babel/core@7.26.0))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1))(ember-qunit@9.0.1(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(miragejs@0.1.48)(webpack@5.97.1) ember-cli-notifications: specifier: 9.1.0 version: 9.1.0(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)) @@ -184,6 +180,9 @@ importers: ember-fetch: specifier: 8.1.2 version: 8.1.2 + ember-inflector: + specifier: 5.0.2 + version: 5.0.2(@babel/core@7.26.0) ember-keyboard: specifier: 9.0.1 version: 9.0.1(@babel/core@7.26.0)(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)) @@ -4102,26 +4101,6 @@ packages: resolution: {integrity: sha512-QkLGcYv1WRK35g4MWu/uIeJ5Suk2eJXKtZ+8s+qE7C9INmpCPyPxzaqZABquYzcWNzIdw6kYwz3NWAFdKYFxwg==} engines: {node: ^4.5 || 6.* || >= 7.*} - ember-cli-mirage@3.0.4: - resolution: {integrity: sha512-JpfZJIrvUAcwOVQ44aAzlYSbGiO4/nqnVAbzAKU4kztqgYvYGBa27FX5WxfpIGZMBdnt6OKh78rsimChWo6f/Q==} - engines: {node: 16.* || >= 18} - peerDependencies: - '@ember-data/model': '*' - '@ember/test-helpers': '*' - ember-data: '*' - ember-qunit: '*' - ember-source: '>= 3.28.0' - miragejs: 0.1.48 - peerDependenciesMeta: - '@ember-data/model': - optional: true - '@ember/test-helpers': - optional: true - ember-data: - optional: true - ember-qunit: - optional: true - ember-cli-normalize-entity-name@1.0.0: resolution: {integrity: sha512-rF4P1rW2P1gVX1ynZYPmuIf7TnAFDiJmIUFI1Xz16VYykUAyiOCme0Y22LeZq8rTzwBMiwBwoE3RO4GYWehXZA==} @@ -4260,10 +4239,6 @@ packages: peerDependencies: ember-source: ^3.25.0 || >=4.0.0 - ember-get-config@2.1.1: - resolution: {integrity: sha512-uNmv1cPG/4qsac8oIf5txJ2FZ8p88LEpG4P3dNcjsJS98Y8hd0GPMFwVqpnzI78Lz7VYRGQWY4jnE4qm5R3j4g==} - engines: {node: 12.* || 14.* || >= 16} - ember-in-element-polyfill@1.0.1: resolution: {integrity: sha512-eHs+7D7PuQr8a1DPqsJTsEyo3FZ1XuH6WEZaEBPDa9s0xLlwByCNKl8hi1EbXOgvgEZNHHi9Rh0vjxyfakrlgg==} engines: {node: 10.* || >= 12} @@ -13947,29 +13922,6 @@ snapshots: ember-cli-lodash-subset@2.0.1: {} - ember-cli-mirage@3.0.4(@ember-data/model@5.3.9(ooa3zjjpg5ssichpukhgmudu7m))(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-data@5.3.9(@ember/string@3.1.1)(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(@ember/test-waiters@3.1.0)(ember-inflector@5.0.2(@babel/core@7.26.0))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1))(ember-qunit@9.0.1(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(miragejs@0.1.48)(webpack@5.97.1): - dependencies: - '@babel/core': 7.26.0(supports-color@8.1.1) - '@embroider/macros': 1.16.10 - broccoli-file-creator: 2.1.1 - broccoli-funnel: 3.0.8 - broccoli-merge-trees: 4.2.0 - ember-auto-import: 2.10.0(webpack@5.97.1) - ember-cli-babel: 8.2.0(@babel/core@7.26.0) - ember-get-config: 2.1.1 - ember-inflector: 5.0.2(@babel/core@7.26.0) - ember-source: 6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1) - miragejs: 0.1.48 - optionalDependencies: - '@ember-data/model': 5.3.9(ooa3zjjpg5ssichpukhgmudu7m) - '@ember/test-helpers': 4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)) - ember-data: 5.3.9(@ember/string@3.1.1)(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(@ember/test-waiters@3.1.0)(ember-inflector@5.0.2(@babel/core@7.26.0))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1) - ember-qunit: 9.0.1(@ember/test-helpers@4.0.4(@babel/core@7.26.0)(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1)))(ember-source@6.0.1(@glimmer/component@2.0.0)(rsvp@4.8.5)(webpack@5.97.1))(qunit@2.23.1) - transitivePeerDependencies: - - '@glint/template' - - supports-color - - webpack - ember-cli-normalize-entity-name@1.0.0: dependencies: silent-error: 1.1.1 @@ -14390,14 +14342,6 @@ snapshots: transitivePeerDependencies: - supports-color - ember-get-config@2.1.1: - dependencies: - '@embroider/macros': 1.16.10 - ember-cli-babel: 7.26.11 - transitivePeerDependencies: - - '@glint/template' - - supports-color - ember-in-element-polyfill@1.0.1: dependencies: debug: 4.4.0(supports-color@8.1.1) diff --git a/tests/acceptance/front-page-test.js b/tests/acceptance/front-page-test.js index bb0f73d28ee..d0568729d59 100644 --- a/tests/acceptance/front-page-test.js +++ b/tests/acceptance/front-page-test.js @@ -9,8 +9,8 @@ import { getPageTitle } from 'ember-page-title/test-support'; import { setupApplicationTest } from 'crates-io/tests/helpers'; -import { summary } from '../../mirage/route-handlers/summary'; import axeConfig from '../axe-config'; +import { summary } from '../mirage/route-handlers/summary'; module('Acceptance | front page', function (hooks) { setupApplicationTest(hooks); diff --git a/tests/acceptance/search-test.js b/tests/acceptance/search-test.js index 9839d633136..8067f94ebb4 100644 --- a/tests/acceptance/search-test.js +++ b/tests/acceptance/search-test.js @@ -10,8 +10,8 @@ import { getPageTitle } from 'ember-page-title/test-support'; import { setupApplicationTest } from 'crates-io/tests/helpers'; -import { list as listCrates } from '../../mirage/route-handlers/crates'; import axeConfig from '../axe-config'; +import { list as listCrates } from '../mirage/route-handlers/crates'; module('Acceptance | search', function (hooks) { setupApplicationTest(hooks); diff --git a/tests/helpers/setup-mirage.js b/tests/helpers/setup-mirage.js index 2672edd6e31..662e350f15f 100644 --- a/tests/helpers/setup-mirage.js +++ b/tests/helpers/setup-mirage.js @@ -1,19 +1,37 @@ -import { setupMirage } from 'ember-cli-mirage/test-support'; +import { settled } from '@ember/test-helpers'; + import window from 'ember-window-mock'; import { setupWindowMock } from 'ember-window-mock/test-support'; +import makeServer from '../mirage/config'; import { setupFakeTimers } from './fake-timers'; export default function (hooks) { - setupMirage(hooks); setupWindowMock(hooks); setupFakeTimers(hooks, '2017-11-20T12:00:00'); // To have deterministic visual tests, the seed has to be constant hooks.beforeEach(function () { + this.server = makeServer({ + environment: 'test', + }); + + if (location.search.includes('mirageLogging')) { + this.server.logging = true; + } + this.authenticateAs = user => { this.server.create('mirage-session', { user }); window.localStorage.setItem('isLoggedIn', '1'); }; }); + + hooks.afterEach(async function () { + await settled(); + + if (this.server) { + this.server.shutdown(); + delete this.server; + } + }); } diff --git a/mirage/config.js b/tests/mirage/config.js similarity index 100% rename from mirage/config.js rename to tests/mirage/config.js diff --git a/mirage/factories/api-token.js b/tests/mirage/factories/api-token.js similarity index 100% rename from mirage/factories/api-token.js rename to tests/mirage/factories/api-token.js diff --git a/mirage/factories/category.js b/tests/mirage/factories/category.js similarity index 100% rename from mirage/factories/category.js rename to tests/mirage/factories/category.js diff --git a/mirage/factories/crate-owner-invitation.js b/tests/mirage/factories/crate-owner-invitation.js similarity index 100% rename from mirage/factories/crate-owner-invitation.js rename to tests/mirage/factories/crate-owner-invitation.js diff --git a/mirage/factories/crate-ownership.js b/tests/mirage/factories/crate-ownership.js similarity index 100% rename from mirage/factories/crate-ownership.js rename to tests/mirage/factories/crate-ownership.js diff --git a/mirage/factories/crate.js b/tests/mirage/factories/crate.js similarity index 100% rename from mirage/factories/crate.js rename to tests/mirage/factories/crate.js diff --git a/mirage/factories/dependency.js b/tests/mirage/factories/dependency.js similarity index 100% rename from mirage/factories/dependency.js rename to tests/mirage/factories/dependency.js diff --git a/mirage/factories/index.js b/tests/mirage/factories/index.js similarity index 100% rename from mirage/factories/index.js rename to tests/mirage/factories/index.js diff --git a/mirage/factories/keyword.js b/tests/mirage/factories/keyword.js similarity index 100% rename from mirage/factories/keyword.js rename to tests/mirage/factories/keyword.js diff --git a/mirage/factories/mirage-session.js b/tests/mirage/factories/mirage-session.js similarity index 100% rename from mirage/factories/mirage-session.js rename to tests/mirage/factories/mirage-session.js diff --git a/mirage/factories/team.js b/tests/mirage/factories/team.js similarity index 100% rename from mirage/factories/team.js rename to tests/mirage/factories/team.js diff --git a/mirage/factories/user.js b/tests/mirage/factories/user.js similarity index 100% rename from mirage/factories/user.js rename to tests/mirage/factories/user.js diff --git a/mirage/factories/version-download.js b/tests/mirage/factories/version-download.js similarity index 100% rename from mirage/factories/version-download.js rename to tests/mirage/factories/version-download.js diff --git a/mirage/factories/version.js b/tests/mirage/factories/version.js similarity index 100% rename from mirage/factories/version.js rename to tests/mirage/factories/version.js diff --git a/mirage/fixtures/categories.js b/tests/mirage/fixtures/categories.js similarity index 100% rename from mirage/fixtures/categories.js rename to tests/mirage/fixtures/categories.js diff --git a/mirage/fixtures/crate-ownerships.js b/tests/mirage/fixtures/crate-ownerships.js similarity index 100% rename from mirage/fixtures/crate-ownerships.js rename to tests/mirage/fixtures/crate-ownerships.js diff --git a/mirage/fixtures/crates.js b/tests/mirage/fixtures/crates.js similarity index 100% rename from mirage/fixtures/crates.js rename to tests/mirage/fixtures/crates.js diff --git a/mirage/fixtures/dependencies.js b/tests/mirage/fixtures/dependencies.js similarity index 100% rename from mirage/fixtures/dependencies.js rename to tests/mirage/fixtures/dependencies.js diff --git a/mirage/fixtures/index.js b/tests/mirage/fixtures/index.js similarity index 100% rename from mirage/fixtures/index.js rename to tests/mirage/fixtures/index.js diff --git a/mirage/fixtures/keywords.js b/tests/mirage/fixtures/keywords.js similarity index 100% rename from mirage/fixtures/keywords.js rename to tests/mirage/fixtures/keywords.js diff --git a/mirage/fixtures/teams.js b/tests/mirage/fixtures/teams.js similarity index 100% rename from mirage/fixtures/teams.js rename to tests/mirage/fixtures/teams.js diff --git a/mirage/fixtures/users.js b/tests/mirage/fixtures/users.js similarity index 100% rename from mirage/fixtures/users.js rename to tests/mirage/fixtures/users.js diff --git a/mirage/fixtures/version-downloads.js b/tests/mirage/fixtures/version-downloads.js similarity index 100% rename from mirage/fixtures/version-downloads.js rename to tests/mirage/fixtures/version-downloads.js diff --git a/mirage/fixtures/versions.js b/tests/mirage/fixtures/versions.js similarity index 100% rename from mirage/fixtures/versions.js rename to tests/mirage/fixtures/versions.js diff --git a/mirage/models/api-token.js b/tests/mirage/models/api-token.js similarity index 100% rename from mirage/models/api-token.js rename to tests/mirage/models/api-token.js diff --git a/mirage/models/category-slug.js b/tests/mirage/models/category-slug.js similarity index 100% rename from mirage/models/category-slug.js rename to tests/mirage/models/category-slug.js diff --git a/mirage/models/category.js b/tests/mirage/models/category.js similarity index 100% rename from mirage/models/category.js rename to tests/mirage/models/category.js diff --git a/mirage/models/crate-owner-invitation.js b/tests/mirage/models/crate-owner-invitation.js similarity index 100% rename from mirage/models/crate-owner-invitation.js rename to tests/mirage/models/crate-owner-invitation.js diff --git a/mirage/models/crate-ownership.js b/tests/mirage/models/crate-ownership.js similarity index 100% rename from mirage/models/crate-ownership.js rename to tests/mirage/models/crate-ownership.js diff --git a/mirage/models/crate.js b/tests/mirage/models/crate.js similarity index 100% rename from mirage/models/crate.js rename to tests/mirage/models/crate.js diff --git a/mirage/models/dependency.js b/tests/mirage/models/dependency.js similarity index 100% rename from mirage/models/dependency.js rename to tests/mirage/models/dependency.js diff --git a/mirage/models/index.js b/tests/mirage/models/index.js similarity index 100% rename from mirage/models/index.js rename to tests/mirage/models/index.js diff --git a/mirage/models/keyword.js b/tests/mirage/models/keyword.js similarity index 100% rename from mirage/models/keyword.js rename to tests/mirage/models/keyword.js diff --git a/mirage/models/mirage-session.js b/tests/mirage/models/mirage-session.js similarity index 100% rename from mirage/models/mirage-session.js rename to tests/mirage/models/mirage-session.js diff --git a/mirage/models/owned-crate.js b/tests/mirage/models/owned-crate.js similarity index 100% rename from mirage/models/owned-crate.js rename to tests/mirage/models/owned-crate.js diff --git a/mirage/models/team.js b/tests/mirage/models/team.js similarity index 100% rename from mirage/models/team.js rename to tests/mirage/models/team.js diff --git a/mirage/models/user.js b/tests/mirage/models/user.js similarity index 100% rename from mirage/models/user.js rename to tests/mirage/models/user.js diff --git a/mirage/models/version-download.js b/tests/mirage/models/version-download.js similarity index 100% rename from mirage/models/version-download.js rename to tests/mirage/models/version-download.js diff --git a/mirage/models/version.js b/tests/mirage/models/version.js similarity index 100% rename from mirage/models/version.js rename to tests/mirage/models/version.js diff --git a/mirage/route-handlers/-utils.js b/tests/mirage/route-handlers/-utils.js similarity index 100% rename from mirage/route-handlers/-utils.js rename to tests/mirage/route-handlers/-utils.js diff --git a/mirage/route-handlers/categories.js b/tests/mirage/route-handlers/categories.js similarity index 100% rename from mirage/route-handlers/categories.js rename to tests/mirage/route-handlers/categories.js diff --git a/mirage/route-handlers/crates.js b/tests/mirage/route-handlers/crates.js similarity index 100% rename from mirage/route-handlers/crates.js rename to tests/mirage/route-handlers/crates.js diff --git a/mirage/route-handlers/docs-rs.js b/tests/mirage/route-handlers/docs-rs.js similarity index 100% rename from mirage/route-handlers/docs-rs.js rename to tests/mirage/route-handlers/docs-rs.js diff --git a/mirage/route-handlers/index.js b/tests/mirage/route-handlers/index.js similarity index 100% rename from mirage/route-handlers/index.js rename to tests/mirage/route-handlers/index.js diff --git a/mirage/route-handlers/invites.js b/tests/mirage/route-handlers/invites.js similarity index 100% rename from mirage/route-handlers/invites.js rename to tests/mirage/route-handlers/invites.js diff --git a/mirage/route-handlers/keywords.js b/tests/mirage/route-handlers/keywords.js similarity index 100% rename from mirage/route-handlers/keywords.js rename to tests/mirage/route-handlers/keywords.js diff --git a/mirage/route-handlers/me.js b/tests/mirage/route-handlers/me.js similarity index 100% rename from mirage/route-handlers/me.js rename to tests/mirage/route-handlers/me.js diff --git a/mirage/route-handlers/metadata.js b/tests/mirage/route-handlers/metadata.js similarity index 100% rename from mirage/route-handlers/metadata.js rename to tests/mirage/route-handlers/metadata.js diff --git a/mirage/route-handlers/session.js b/tests/mirage/route-handlers/session.js similarity index 100% rename from mirage/route-handlers/session.js rename to tests/mirage/route-handlers/session.js diff --git a/mirage/route-handlers/summary.js b/tests/mirage/route-handlers/summary.js similarity index 100% rename from mirage/route-handlers/summary.js rename to tests/mirage/route-handlers/summary.js diff --git a/mirage/route-handlers/teams.js b/tests/mirage/route-handlers/teams.js similarity index 100% rename from mirage/route-handlers/teams.js rename to tests/mirage/route-handlers/teams.js diff --git a/mirage/route-handlers/users.js b/tests/mirage/route-handlers/users.js similarity index 100% rename from mirage/route-handlers/users.js rename to tests/mirage/route-handlers/users.js diff --git a/mirage/serializers/api-token.js b/tests/mirage/serializers/api-token.js similarity index 100% rename from mirage/serializers/api-token.js rename to tests/mirage/serializers/api-token.js diff --git a/mirage/serializers/application.js b/tests/mirage/serializers/application.js similarity index 100% rename from mirage/serializers/application.js rename to tests/mirage/serializers/application.js diff --git a/mirage/serializers/category.js b/tests/mirage/serializers/category.js similarity index 100% rename from mirage/serializers/category.js rename to tests/mirage/serializers/category.js diff --git a/mirage/serializers/crate-owner-invitation.js b/tests/mirage/serializers/crate-owner-invitation.js similarity index 100% rename from mirage/serializers/crate-owner-invitation.js rename to tests/mirage/serializers/crate-owner-invitation.js diff --git a/mirage/serializers/crate.js b/tests/mirage/serializers/crate.js similarity index 100% rename from mirage/serializers/crate.js rename to tests/mirage/serializers/crate.js diff --git a/mirage/serializers/dependency.js b/tests/mirage/serializers/dependency.js similarity index 100% rename from mirage/serializers/dependency.js rename to tests/mirage/serializers/dependency.js diff --git a/mirage/serializers/index.js b/tests/mirage/serializers/index.js similarity index 100% rename from mirage/serializers/index.js rename to tests/mirage/serializers/index.js diff --git a/mirage/serializers/keyword.js b/tests/mirage/serializers/keyword.js similarity index 100% rename from mirage/serializers/keyword.js rename to tests/mirage/serializers/keyword.js diff --git a/mirage/serializers/team.js b/tests/mirage/serializers/team.js similarity index 100% rename from mirage/serializers/team.js rename to tests/mirage/serializers/team.js diff --git a/mirage/serializers/user.js b/tests/mirage/serializers/user.js similarity index 100% rename from mirage/serializers/user.js rename to tests/mirage/serializers/user.js diff --git a/mirage/serializers/version-download.js b/tests/mirage/serializers/version-download.js similarity index 100% rename from mirage/serializers/version-download.js rename to tests/mirage/serializers/version-download.js diff --git a/mirage/serializers/version.js b/tests/mirage/serializers/version.js similarity index 100% rename from mirage/serializers/version.js rename to tests/mirage/serializers/version.js diff --git a/tests/mirage/categories/get-by-id-test.js b/tests/mirage/tests/categories/get-by-id-test.js similarity index 94% rename from tests/mirage/categories/get-by-id-test.js rename to tests/mirage/tests/categories/get-by-id-test.js index 04f4dfcbac9..584e5e27679 100644 --- a/tests/mirage/categories/get-by-id-test.js +++ b/tests/mirage/tests/categories/get-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/categories/:id', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/categories/list-test.js b/tests/mirage/tests/categories/list-test.js similarity index 96% rename from tests/mirage/categories/list-test.js rename to tests/mirage/tests/categories/list-test.js index d19a6bf057c..337aeb0dc73 100644 --- a/tests/mirage/categories/list-test.js +++ b/tests/mirage/tests/categories/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/categories', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/category-slugs/list-test.js b/tests/mirage/tests/category-slugs/list-test.js similarity index 94% rename from tests/mirage/category-slugs/list-test.js rename to tests/mirage/tests/category-slugs/list-test.js index 573ecb105cc..403550928f4 100644 --- a/tests/mirage/category-slugs/list-test.js +++ b/tests/mirage/tests/category-slugs/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/category_slugs', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/confirm/put-by-id-test.js b/tests/mirage/tests/confirm/put-by-id-test.js similarity index 93% rename from tests/mirage/confirm/put-by-id-test.js rename to tests/mirage/tests/confirm/put-by-id-test.js index 543b6cd0dad..db4e19ea3ad 100644 --- a/tests/mirage/confirm/put-by-id-test.js +++ b/tests/mirage/tests/confirm/put-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/confirm/:token', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/add-owner-test.js b/tests/mirage/tests/crates/add-owner-test.js similarity index 97% rename from tests/mirage/crates/add-owner-test.js rename to tests/mirage/tests/crates/add-owner-test.js index 05463d2710e..bc0de1c2593 100644 --- a/tests/mirage/crates/add-owner-test.js +++ b/tests/mirage/tests/crates/add-owner-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; const ADD_USER_BODY = JSON.stringify({ owners: ['john-doe'] }); diff --git a/tests/mirage/crates/delete-test.js b/tests/mirage/tests/crates/delete-test.js similarity index 93% rename from tests/mirage/crates/delete-test.js rename to tests/mirage/tests/crates/delete-test.js index 20a56924f32..377c1e98eab 100644 --- a/tests/mirage/crates/delete-test.js +++ b/tests/mirage/tests/crates/delete-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | DELETE /api/v1/crates/:name', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/downloads-test.js b/tests/mirage/tests/crates/downloads-test.js similarity index 94% rename from tests/mirage/crates/downloads-test.js rename to tests/mirage/tests/crates/downloads-test.js index be9f46ef23e..33f0d208ac1 100644 --- a/tests/mirage/crates/downloads-test.js +++ b/tests/mirage/tests/crates/downloads-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:id/downloads', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/follow/delete-test.js b/tests/mirage/tests/crates/follow/delete-test.js similarity index 93% rename from tests/mirage/crates/follow/delete-test.js rename to tests/mirage/tests/crates/follow/delete-test.js index 13e7dc02bc4..52f36a03a38 100644 --- a/tests/mirage/crates/follow/delete-test.js +++ b/tests/mirage/tests/crates/follow/delete-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | DELETE /api/v1/crates/:crateId/follow', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/follow/get-test.js b/tests/mirage/tests/crates/follow/get-test.js similarity index 93% rename from tests/mirage/crates/follow/get-test.js rename to tests/mirage/tests/crates/follow/get-test.js index c0b4cb15a27..c13c6de05e8 100644 --- a/tests/mirage/crates/follow/get-test.js +++ b/tests/mirage/tests/crates/follow/get-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:crateId/following', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/follow/put-test.js b/tests/mirage/tests/crates/follow/put-test.js similarity index 92% rename from tests/mirage/crates/follow/put-test.js rename to tests/mirage/tests/crates/follow/put-test.js index f13af61b067..01e4df09415 100644 --- a/tests/mirage/crates/follow/put-test.js +++ b/tests/mirage/tests/crates/follow/put-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/crates/:crateId/follow', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/get-by-id-test.js b/tests/mirage/tests/crates/get-by-id-test.js similarity index 98% rename from tests/mirage/crates/get-by-id-test.js rename to tests/mirage/tests/crates/get-by-id-test.js index 712ea30b89a..b2a1b2b3106 100644 --- a/tests/mirage/crates/get-by-id-test.js +++ b/tests/mirage/tests/crates/get-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:id', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/list-test.js b/tests/mirage/tests/crates/list-test.js similarity index 98% rename from tests/mirage/crates/list-test.js rename to tests/mirage/tests/crates/list-test.js index 23e4f630432..d6efd08e9b8 100644 --- a/tests/mirage/crates/list-test.js +++ b/tests/mirage/tests/crates/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/owner-team-test.js b/tests/mirage/tests/crates/owner-team-test.js similarity index 93% rename from tests/mirage/crates/owner-team-test.js rename to tests/mirage/tests/crates/owner-team-test.js index 25e9a8e10fe..449e048e974 100644 --- a/tests/mirage/crates/owner-team-test.js +++ b/tests/mirage/tests/crates/owner-team-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:id/owner_team', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/owner-user-test.js b/tests/mirage/tests/crates/owner-user-test.js similarity index 93% rename from tests/mirage/crates/owner-user-test.js rename to tests/mirage/tests/crates/owner-user-test.js index 43d3b4af95a..75dc41746fc 100644 --- a/tests/mirage/crates/owner-user-test.js +++ b/tests/mirage/tests/crates/owner-user-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:id/owner_user', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/reverse-dependencies-test.js b/tests/mirage/tests/crates/reverse-dependencies-test.js similarity index 98% rename from tests/mirage/crates/reverse-dependencies-test.js rename to tests/mirage/tests/crates/reverse-dependencies-test.js index 4976cf6cecd..c169cab38f9 100644 --- a/tests/mirage/crates/reverse-dependencies-test.js +++ b/tests/mirage/tests/crates/reverse-dependencies-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:id/reverse_dependencies', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/authors-test.js b/tests/mirage/tests/crates/versions/authors-test.js similarity index 93% rename from tests/mirage/crates/versions/authors-test.js rename to tests/mirage/tests/crates/versions/authors-test.js index 8f8bbab45bb..188436be8eb 100644 --- a/tests/mirage/crates/versions/authors-test.js +++ b/tests/mirage/tests/crates/versions/authors-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/:version/authors', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/dependencies-test.js b/tests/mirage/tests/crates/versions/dependencies-test.js similarity index 96% rename from tests/mirage/crates/versions/dependencies-test.js rename to tests/mirage/tests/crates/versions/dependencies-test.js index 823663ee2ea..9e0066cdb59 100644 --- a/tests/mirage/crates/versions/dependencies-test.js +++ b/tests/mirage/tests/crates/versions/dependencies-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/:version/dependencies', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/downloads-test.js b/tests/mirage/tests/crates/versions/downloads-test.js similarity index 95% rename from tests/mirage/crates/versions/downloads-test.js rename to tests/mirage/tests/crates/versions/downloads-test.js index 59ea3125726..693ad569ca8 100644 --- a/tests/mirage/crates/versions/downloads-test.js +++ b/tests/mirage/tests/crates/versions/downloads-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/:version/downloads', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/get-by-num-test.js b/tests/mirage/tests/crates/versions/get-by-num-test.js similarity index 94% rename from tests/mirage/crates/versions/get-by-num-test.js rename to tests/mirage/tests/crates/versions/get-by-num-test.js index 27496883322..6c8daf35fd0 100644 --- a/tests/mirage/crates/versions/get-by-num-test.js +++ b/tests/mirage/tests/crates/versions/get-by-num-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/:version', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/list-test.js b/tests/mirage/tests/crates/versions/list-test.js similarity index 98% rename from tests/mirage/crates/versions/list-test.js rename to tests/mirage/tests/crates/versions/list-test.js index 42fe9fbd90b..876a9b340f4 100644 --- a/tests/mirage/crates/versions/list-test.js +++ b/tests/mirage/tests/crates/versions/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/versions', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/patch-test.js b/tests/mirage/tests/crates/versions/patch-test.js similarity index 97% rename from tests/mirage/crates/versions/patch-test.js rename to tests/mirage/tests/crates/versions/patch-test.js index 00472129f38..b9ccd76b6eb 100644 --- a/tests/mirage/crates/versions/patch-test.js +++ b/tests/mirage/tests/crates/versions/patch-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; const YANK_BODY = JSON.stringify({ version: { diff --git a/tests/mirage/crates/versions/readme-test.js b/tests/mirage/tests/crates/versions/readme-test.js similarity index 93% rename from tests/mirage/crates/versions/readme-test.js rename to tests/mirage/tests/crates/versions/readme-test.js index 03746524f95..3d19f67e20d 100644 --- a/tests/mirage/crates/versions/readme-test.js +++ b/tests/mirage/tests/crates/versions/readme-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/crates/:name/:version/readme', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/yank/unyank-test.js b/tests/mirage/tests/crates/versions/yank/unyank-test.js similarity index 94% rename from tests/mirage/crates/versions/yank/unyank-test.js rename to tests/mirage/tests/crates/versions/yank/unyank-test.js index b5fa969a79e..c26df6f0708 100644 --- a/tests/mirage/crates/versions/yank/unyank-test.js +++ b/tests/mirage/tests/crates/versions/yank/unyank-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../../helpers'; -import setupMirage from '../../../../helpers/setup-mirage'; +import { setupTest } from '../../../../../helpers'; +import setupMirage from '../../../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/crates/:name/unyank', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/crates/versions/yank/yank-test.js b/tests/mirage/tests/crates/versions/yank/yank-test.js similarity index 94% rename from tests/mirage/crates/versions/yank/yank-test.js rename to tests/mirage/tests/crates/versions/yank/yank-test.js index a08af7055c2..68780a06f3a 100644 --- a/tests/mirage/crates/versions/yank/yank-test.js +++ b/tests/mirage/tests/crates/versions/yank/yank-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../../helpers'; -import setupMirage from '../../../../helpers/setup-mirage'; +import { setupTest } from '../../../../../helpers'; +import setupMirage from '../../../../../helpers/setup-mirage'; module('Mirage | DELETE /api/v1/crates/:name/yank', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/keywords/get-by-id-test.js b/tests/mirage/tests/keywords/get-by-id-test.js similarity index 93% rename from tests/mirage/keywords/get-by-id-test.js rename to tests/mirage/tests/keywords/get-by-id-test.js index 751cc873dc5..0228933c58e 100644 --- a/tests/mirage/keywords/get-by-id-test.js +++ b/tests/mirage/tests/keywords/get-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/keywords/:id', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/keywords/list-test.js b/tests/mirage/tests/keywords/list-test.js similarity index 95% rename from tests/mirage/keywords/list-test.js rename to tests/mirage/tests/keywords/list-test.js index 6e63c55a853..27fb32461f3 100644 --- a/tests/mirage/keywords/list-test.js +++ b/tests/mirage/tests/keywords/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/keywords', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/crate-owner-invitations/list-test.js b/tests/mirage/tests/me/crate-owner-invitations/list-test.js similarity index 96% rename from tests/mirage/me/crate-owner-invitations/list-test.js rename to tests/mirage/tests/me/crate-owner-invitations/list-test.js index 4811dd866f0..c7903eaefbc 100644 --- a/tests/mirage/me/crate-owner-invitations/list-test.js +++ b/tests/mirage/tests/me/crate-owner-invitations/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/get-test.js b/tests/mirage/tests/me/get-test.js similarity index 94% rename from tests/mirage/me/get-test.js rename to tests/mirage/tests/me/get-test.js index 2d1f63e7668..77d03bace19 100644 --- a/tests/mirage/me/get-test.js +++ b/tests/mirage/tests/me/get-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/me', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/tokens/create-test.js b/tests/mirage/tests/me/tokens/create-test.js similarity index 96% rename from tests/mirage/me/tokens/create-test.js rename to tests/mirage/tests/me/tokens/create-test.js index 7b28c309e08..f1ecb32d666 100644 --- a/tests/mirage/me/tokens/create-test.js +++ b/tests/mirage/tests/me/tokens/create-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/me/tokens', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/tokens/delete-by-id-test.js b/tests/mirage/tests/me/tokens/delete-by-id-test.js similarity index 91% rename from tests/mirage/me/tokens/delete-by-id-test.js rename to tests/mirage/tests/me/tokens/delete-by-id-test.js index d6d61209404..390fabdc043 100644 --- a/tests/mirage/me/tokens/delete-by-id-test.js +++ b/tests/mirage/tests/me/tokens/delete-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | DELETE /api/v1/me/tokens/:tokenId', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/tokens/list-test.js b/tests/mirage/tests/me/tokens/list-test.js similarity index 95% rename from tests/mirage/me/tokens/list-test.js rename to tests/mirage/tests/me/tokens/list-test.js index ab2450cef8a..951d623ad5e 100644 --- a/tests/mirage/me/tokens/list-test.js +++ b/tests/mirage/tests/me/tokens/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/me/tokens', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/me/updates/list-test.js b/tests/mirage/tests/me/updates/list-test.js similarity index 96% rename from tests/mirage/me/updates/list-test.js rename to tests/mirage/tests/me/updates/list-test.js index b67762befd5..ba27a818251 100644 --- a/tests/mirage/me/updates/list-test.js +++ b/tests/mirage/tests/me/updates/list-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/me/updates', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/private/crate-owner-invitations/get-test.js b/tests/mirage/tests/private/crate-owner-invitations/get-test.js similarity index 98% rename from tests/mirage/private/crate-owner-invitations/get-test.js rename to tests/mirage/tests/private/crate-owner-invitations/get-test.js index 9ea3a225262..b9c0518928a 100644 --- a/tests/mirage/private/crate-owner-invitations/get-test.js +++ b/tests/mirage/tests/private/crate-owner-invitations/get-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | GET /api/private/crate_owner_invitations', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/private/session/delete-test.js b/tests/mirage/tests/private/session/delete-test.js similarity index 89% rename from tests/mirage/private/session/delete-test.js rename to tests/mirage/tests/private/session/delete-test.js index 84e2cddf83d..5d1c83809f8 100644 --- a/tests/mirage/private/session/delete-test.js +++ b/tests/mirage/tests/private/session/delete-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../../helpers'; -import setupMirage from '../../../helpers/setup-mirage'; +import { setupTest } from '../../../../helpers'; +import setupMirage from '../../../../helpers/setup-mirage'; module('Mirage | DELETE /api/private/session', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/summary-test.js b/tests/mirage/tests/summary-test.js similarity index 99% rename from tests/mirage/summary-test.js rename to tests/mirage/tests/summary-test.js index 5686aeb128d..9e1a498c598 100644 --- a/tests/mirage/summary-test.js +++ b/tests/mirage/tests/summary-test.js @@ -4,7 +4,7 @@ import fetch from 'fetch'; import { setupTest } from 'crates-io/tests/helpers'; -import setupMirage from '../helpers/setup-mirage'; +import setupMirage from '../../helpers/setup-mirage'; module('Mirage | GET /api/v1/summary', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/teams/get-by-id-test.js b/tests/mirage/tests/teams/get-by-id-test.js similarity index 90% rename from tests/mirage/teams/get-by-id-test.js rename to tests/mirage/tests/teams/get-by-id-test.js index 85dcd0c98fe..db26a668a26 100644 --- a/tests/mirage/teams/get-by-id-test.js +++ b/tests/mirage/tests/teams/get-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/teams/:id', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/users/get-by-id-test.js b/tests/mirage/tests/users/get-by-id-test.js similarity index 90% rename from tests/mirage/users/get-by-id-test.js rename to tests/mirage/tests/users/get-by-id-test.js index 7164d291f06..aeb97eb1207 100644 --- a/tests/mirage/users/get-by-id-test.js +++ b/tests/mirage/tests/users/get-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | GET /api/v1/users/:id', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/users/resend-by-id-test.js b/tests/mirage/tests/users/resend-by-id-test.js similarity index 92% rename from tests/mirage/users/resend-by-id-test.js rename to tests/mirage/tests/users/resend-by-id-test.js index 7e0111196be..d0c08b1c79d 100644 --- a/tests/mirage/users/resend-by-id-test.js +++ b/tests/mirage/tests/users/resend-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/users/:id/resend', function (hooks) { setupTest(hooks); diff --git a/tests/mirage/users/update-by-id-test.js b/tests/mirage/tests/users/update-by-id-test.js similarity index 97% rename from tests/mirage/users/update-by-id-test.js rename to tests/mirage/tests/users/update-by-id-test.js index 8019c7d22eb..e5c701becb5 100644 --- a/tests/mirage/users/update-by-id-test.js +++ b/tests/mirage/tests/users/update-by-id-test.js @@ -2,8 +2,8 @@ import { module, test } from 'qunit'; import fetch from 'fetch'; -import { setupTest } from '../../helpers'; -import setupMirage from '../../helpers/setup-mirage'; +import { setupTest } from '../../../helpers'; +import setupMirage from '../../../helpers/setup-mirage'; module('Mirage | PUT /api/v1/users/:id', function (hooks) { setupTest(hooks); diff --git a/mirage/utils/session.js b/tests/mirage/utils/session.js similarity index 100% rename from mirage/utils/session.js rename to tests/mirage/utils/session.js diff --git a/tests/test-helper.js b/tests/test-helper.js index 0e41823d0aa..7c9c6e7837a 100644 --- a/tests/test-helper.js +++ b/tests/test-helper.js @@ -9,6 +9,11 @@ import Application from '../app'; import config from '../config/environment'; import registerMatchJsonAssertion from './helpers/match-json'; +QUnit.config.urlConfig.push({ + id: 'mirageLogging', + label: 'Mirage logging', +}); + setup(QUnit.assert); registerMatchJsonAssertion(QUnit.assert);