From 7af62be7e0b1f32c734fa5e5ec5000d4c7eb2349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Bryxi=CC=81?= Date: Wed, 25 Sep 2024 10:16:28 +0200 Subject: [PATCH] fix: @ember/test-helpers `setResolver` or `setApplication` before running any tests - Without this patch many tests fail for me with: ``` Promise rejected before "can access files": You must set up the ember-test-helpers environment with either `setResolver` or `setApplication` before running any tests. ``` - Fixes #1083 - Might need https://github.com/adopted-ember-addons/ember-file-upload/pull/1082 to be applied before this fix is useable --- pnpm-lock.yaml | 86 ++++++++++++++++++++++++++++++++++++++++--- test-app/package.json | 2 +- 2 files changed, 82 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c812c57..4b6938cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -160,8 +160,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 '@ember/test-helpers': - specifier: ^4.0.4 - version: 4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)) + specifier: ^3.3.1 + version: 3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0) '@embroider/test-setup': specifier: ^3.0.0 version: 3.0.3(@embroider/core@3.4.4(@glint/template@1.3.0)) @@ -230,7 +230,7 @@ importers: version: 2.1.0 ember-cli-mirage: specifier: ^3.0.0 - version: 3.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-qunit@8.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0))(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(miragejs@0.1.48)(webpack@5.94.0) + version: 3.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-qunit@8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0))(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(miragejs@0.1.48)(webpack@5.94.0) ember-cli-sri: specifier: ^2.1.1 version: 2.1.1 @@ -245,7 +245,7 @@ importers: version: 8.1.2(encoding@0.1.13) ember-file-upload: specifier: workspace:* - version: file:ember-file-upload(wokcqskjvtfwvqqvl7fpmt5lo4) + version: file:ember-file-upload(zfibswdzvlg2rcd4tcrngio7ma) ember-load-initializers: specifier: ^2.1.2 version: 2.1.2(@babel/core@7.25.2) @@ -257,7 +257,7 @@ importers: version: 8.2.1(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)) ember-qunit: specifier: ^8.0.1 - version: 8.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0) + version: 8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0) ember-resolver: specifier: ^11.0.1 version: 11.0.1(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)) @@ -1234,6 +1234,12 @@ packages: '@ember/string@4.0.0': resolution: {integrity: sha512-IMVyVE72twuAMSYcHzWSgtgYTtzlHlKSGW8vEbztnnmkU6uo7kVHmiqSN9R4RkBhzvh0VD4G76Eph+55t3iNIA==} + '@ember/test-helpers@3.3.1': + resolution: {integrity: sha512-h4uFBy4pquBtHsHI+tx9S0wtMmn1L+8dkXiDiyoqG1+3e0Awk6GBujiFM9s4ANq6wC8uIhC3wEFyts10h2OAoQ==} + engines: {node: 16.* || >= 18} + peerDependencies: + ember-source: ^4.0.0 || ^5.0.0 + '@ember/test-helpers@4.0.4': resolution: {integrity: sha512-1mbOVyVEcLxYOGzBaeeaQkCrL1o9Av86QaHk/1RvrVBW24I6YUj1ILLEi2qLZT5PzcCy0TdfadHT3hKJwJ0GcQ==} peerDependencies: @@ -8872,6 +8878,24 @@ snapshots: '@ember/string@4.0.0': {} + '@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0)': + dependencies: + '@ember/test-waiters': 3.1.0 + '@embroider/macros': 1.16.6(@glint/template@1.3.0) + '@simple-dom/interface': 1.4.0 + broccoli-debug: 0.6.5 + broccoli-funnel: 3.0.8 + dom-element-descriptors: 0.5.1 + ember-auto-import: 2.7.4(@glint/template@1.3.0)(webpack@5.94.0) + ember-cli-babel: 8.2.0(@babel/core@7.25.2) + ember-cli-htmlbars: 6.3.0 + ember-source: 5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0) + transitivePeerDependencies: + - '@babel/core' + - '@glint/template' + - supports-color + - webpack + '@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))': dependencies: '@ember/test-waiters': 3.1.0 @@ -11666,6 +11690,27 @@ snapshots: ember-cli-lodash-subset@2.0.1: {} + ember-cli-mirage@3.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-qunit@8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0))(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(miragejs@0.1.48)(webpack@5.94.0): + dependencies: + '@babel/core': 7.25.2 + '@embroider/macros': 1.13.5(@glint/template@1.3.0) + broccoli-file-creator: 2.1.1 + broccoli-funnel: 3.0.8 + broccoli-merge-trees: 4.2.0 + ember-auto-import: 2.7.2(@glint/template@1.3.0)(webpack@5.94.0) + ember-cli-babel: 8.2.0(@babel/core@7.25.2) + ember-get-config: 2.1.1(@glint/template@1.3.0) + ember-inflector: 4.0.2 + ember-source: 5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0) + miragejs: 0.1.48 + optionalDependencies: + '@ember/test-helpers': 3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0) + ember-qunit: 8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0) + transitivePeerDependencies: + - '@glint/template' + - supports-color + - webpack + ember-cli-mirage@3.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-qunit@8.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0))(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(miragejs@0.1.48)(webpack@5.94.0): dependencies: '@babel/core': 7.25.2 @@ -12046,6 +12091,25 @@ snapshots: - supports-color - webpack + ember-file-upload@file:ember-file-upload(zfibswdzvlg2rcd4tcrngio7ma): + dependencies: + '@ember/test-helpers': 3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0) + '@ember/test-waiters': 3.1.0 + '@embroider/addon-shim': 1.8.7 + '@embroider/macros': 1.13.5(@glint/template@1.3.0) + '@glimmer/component': 1.1.2(@babel/core@7.25.2) + '@glimmer/tracking': 1.1.2 + ember-auto-import: 2.7.2(@glint/template@1.3.0)(webpack@5.94.0) + ember-modifier: 4.1.0(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)) + tracked-built-ins: 3.3.0 + optionalDependencies: + ember-cli-mirage: 3.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-qunit@8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0))(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(miragejs@0.1.48)(webpack@5.94.0) + miragejs: 0.1.48 + transitivePeerDependencies: + - '@glint/template' + - supports-color + - webpack + ember-get-config@1.1.0(@glint/template@1.3.0): dependencies: '@embroider/macros': 1.13.5(@glint/template@1.3.0) @@ -12133,6 +12197,18 @@ snapshots: transitivePeerDependencies: - supports-color + ember-qunit@8.0.2(@ember/test-helpers@3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0): + dependencies: + '@ember/test-helpers': 3.3.1(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(webpack@5.94.0) + '@embroider/addon-shim': 1.8.7 + '@embroider/macros': 1.13.5(@glint/template@1.3.0) + ember-cli-test-loader: 3.1.0 + ember-source: 5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0) + qunit: 2.20.0 + transitivePeerDependencies: + - '@glint/template' + - supports-color + ember-qunit@8.0.2(@ember/test-helpers@4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)))(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0))(qunit@2.20.0): dependencies: '@ember/test-helpers': 4.0.4(@babel/core@7.25.2)(@glint/template@1.3.0)(ember-source@5.11.0(@glimmer/component@1.1.2(@babel/core@7.25.2))(@glint/template@1.3.0)(rsvp@4.8.5)(webpack@5.94.0)) diff --git a/test-app/package.json b/test-app/package.json index 037bc26a..0bfdb162 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -30,7 +30,7 @@ "@babel/core": "^7.23.2", "@ember/optional-features": "^2.0.0", "@ember/string": "^4.0.0", - "@ember/test-helpers": "^4.0.4", + "@ember/test-helpers": "^3.3.1", "@embroider/test-setup": "^3.0.0", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2",