Skip to content

Commit

Permalink
chore: bump range for @ember/test-helpers to include 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jan 30, 2025
1 parent 1be6d58 commit f643e89
Show file tree
Hide file tree
Showing 27 changed files with 645 additions and 571 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"devDependencies": {
"@babel/core": "^7.24.5",
"@ember/test-helpers": "3.3.0",
"@glimmer/component": "^1.1.2",
"@glint/core": "1.5.0",
"@glint/environment-ember-loose": "1.5.0",
Expand Down Expand Up @@ -169,11 +168,13 @@
"typescript"
]
},
"allowNonAppliedPatches": true,
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"@ember/[email protected]": "patches/@[email protected]",
"@ember/[email protected]": "patches/@[email protected]"
"@ember/[email protected]": "patches/@[email protected]",
"@ember/[email protected]": "patches/@[email protected]"
}
}
}
4 changes: 2 additions & 2 deletions packages/-ember-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
},
"peerDependencies": {
"ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
"@ember/test-helpers": "^3.3.0 || ^4.0.4",
"@ember/test-helpers": "^3.3.0 || ^4.0.4 || ^5.1.0",
"@ember/test-waiters": "^3.1.0 || ^4.0.0",
"qunit": "^2.18.0"
},
Expand All @@ -150,7 +150,7 @@
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@types/qunit": "2.19.10",
"@ember/test-helpers": "4.0.4",
"@ember/test-helpers": "5.1.0",
"@warp-drive/internal-config": "workspace:*",
"ember-source": "~5.12.0",
"eslint": "^9.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/diagnostic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ module('My Module', function(hooks) {
1. Add the following peer-deps to your app:

```diff
+ "@ember/test-helpers": "^3.3.0 || ^4.0.4",
+ "@ember/test-helpers": "^3.3.0 || ^4.0.4 || ^5.1.0",
+ "ember-cli-test-loader": ">= 3.1.0",
+ "@embroider/addon-shim": ">= 1.8.6"
```
Expand Down
4 changes: 2 additions & 2 deletions packages/diagnostic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"peerDependencies": {
"ember-source": "3.28.12 || ^4.0.4 || ^5.0.0 || ^6.0.0",
"@ember/test-helpers": "4.0.4",
"@ember/test-helpers": "5.1.0",
"ember-cli-test-loader": ">= 3.1.0"
},
"peerDependenciesMeta": {
Expand Down Expand Up @@ -103,7 +103,7 @@
"@babel/runtime": "^7.24.5",
"@warp-drive/internal-config": "workspace:*",
"bun-types": "^1.1.30",
"@ember/test-helpers": "4.0.4",
"@ember/test-helpers": "5.1.0",
"ember-source": "~5.12.0",
"@glimmer/component": "^1.1.2",
"ember-cli-test-loader": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@ember-data/request-utils": "workspace:*",
"@ember-data/store": "workspace:*",
"@ember-data/tracking": "workspace:*",
"@ember/test-helpers": "4.0.4",
"@ember/test-helpers": "5.1.0",
"@warp-drive/core-types": "workspace:*",
"@warp-drive/internal-config": "workspace:*",
"babel-plugin-ember-template-compilation": "^2.2.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/unpublished-test-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@ember-data/tracking": "workspace:*",
"@warp-drive/diagnostic": "workspace:*",
"@warp-drive/core-types": "workspace:*",
"@ember/test-helpers": "3.3.0 || ^4.0.4"
"@ember/test-helpers": "3.3.0 || ^4.0.4 || ^5.1.0"
},
"peerDependenciesMeta": {
"qunit": {
Expand All @@ -101,7 +101,7 @@
"@babel/plugin-transform-typescript": "^7.24.5",
"@babel/preset-env": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@ember/test-helpers": "4.0.4",
"@ember/test-helpers": "5.1.0",
"@glimmer/component": "^1.1.2",
"@types/semver": "^7.5.8",
"@types/qunit": "2.19.10",
Expand Down
101 changes: 101 additions & 0 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
diff --git a/declarations/index.d.ts b/declarations/index.d.ts
index 954e71657c36d820ea4127322d5d1ad051499549..e08cfa594727d300932a4407105cfaf5c49f84c8 100644
--- a/declarations/index.d.ts
+++ b/declarations/index.d.ts
@@ -6,7 +6,7 @@ export type { BaseContext, DeprecationFailure, TestContext, Warning, SetupContex
export { default as setupContext, getContext, setContext, unsetContext, pauseTest, resumeTest, getDeprecations, getDeprecationsDuringCallback, getWarnings, getWarningsDuringCallback, } from './setup-context.ts';
export { default as teardownContext } from './teardown-context.ts';
export type { TeardownContextOptions } from './teardown-context.ts';
-export { default as setupRenderingContext, render, clearRender, } from './setup-rendering-context.ts';
+export { default as setupRenderingContext, render, clearRender, hasCalledSetupRenderingContext } from './setup-rendering-context.ts';
export type { RenderingTestContext } from './setup-rendering-context.ts';
export { default as rerender } from './rerender.ts';
export { default as setupApplicationContext, visit, currentRouteName, currentURL, } from './setup-application-context.ts';
diff --git a/declarations/setup-rendering-context.d.ts b/declarations/setup-rendering-context.d.ts
index 933ae9046751ce93e5a65e484df1d28961157fd2..313434746489d3f6aca00165ac8963f281f8bfc8 100644
--- a/declarations/setup-rendering-context.d.ts
+++ b/declarations/setup-rendering-context.d.ts
@@ -1,6 +1,6 @@
import { type BaseContext, type TestContext } from './setup-context.ts';
import type { Owner } from './build-owner.ts';
-declare const hasCalledSetupRenderingContext: unique symbol;
+export declare const hasCalledSetupRenderingContext: unique symbol;
export interface RenderingTestContext extends TestContext {
element: Element | Document;
[hasCalledSetupRenderingContext]?: true;
diff --git a/dist/build-owner.js b/dist/build-owner.js
index b19c6aa9c1b03b3c858b403164169d6c65205a21..4152a03a24b93f19e17f596d0439673b1aa33d64 100644
--- a/dist/build-owner.js
+++ b/dist/build-owner.js
@@ -20,13 +20,17 @@ import buildRegistry from './-internal/build-registry.js';
@param {Ember.Resolver} [resolver] the resolver to use to back a "mock owner"
@returns {Promise<Ember.ApplicationInstance>} a promise resolving to the generated "owner"
*/
-function buildOwner(application, resolver) {
+function buildOwner(application, resolver, options) {
if (application) {
// @ts-ignore: this type is correct and will check against Ember 4.12 or 5.1
// or later. However, the first round of preview types in Ember 4.8 does not
// include the `visit` API (it was missing for many years!) and therefore
// there is no way to make this assignable accross all supported versions.
- return application.boot().then(app => app.buildInstance().boot());
+ const appBoot = application.boot();
+ return appBoot.then(app => {
+ const instance = app.buildInstance(options);
+ return instance.boot(options);
+ });
}
if (!resolver) {
throw new Error('You must set up the ember-test-helpers environment with either `setResolver` or `setApplication` before running any tests.');
diff --git a/dist/index.js b/dist/index.js
index d511f4c448c172c31a1e70348e2b60e5e7a7321e..336a56fa27e353526f3059a33ffb9673296fc771 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -3,7 +3,7 @@ export { getApplication, setApplication } from './application.js';
export { default as hasEmberVersion } from './has-ember-version.js';
export { j as currentRouteName, k as currentURL, g as getContext, c as getDeprecations, d as getDeprecationsDuringCallback, m as getSettledState, e as getWarnings, f as getWarningsDuringCallback, l as isSettled, p as pauseTest, o as resetOnerror, r as resumeTest, b as setContext, s as settled, h as setupApplicationContext, a as setupContext, n as setupOnerror, u as unsetContext, v as visit } from './setup-context-BtLWn_57.js';
export { default as teardownContext } from './teardown-context.js';
-export { clearRender, render, default as setupRenderingContext } from './setup-rendering-context.js';
+export { clearRender, render, default as setupRenderingContext, hasCalledSetupRenderingContext } from './setup-rendering-context.js';
export { default as rerender } from './rerender.js';
export { default as waitUntil } from './wait-until.js';
export { default as validateErrorHandler } from './validate-error-handler.js';
diff --git a/dist/setup-context-BtLWn_57.js b/dist/setup-context-BtLWn_57.js
index 384dbbd53c649fa11027de3f218cfa22cb88c17b..d2627eaa9948ceb8be0a0db366fcc5b7f987dd3d 100644
--- a/dist/setup-context-BtLWn_57.js
+++ b/dist/setup-context-BtLWn_57.js
@@ -789,7 +789,8 @@ function setupContext(base, options = {}) {
return;
}).then(() => {
const {
- resolver
+ resolver,
+ rootElement
} = options;

// This handles precedence, specifying a specific option of
@@ -799,9 +800,9 @@ function setupContext(base, options = {}) {
// At some later time this can be extended to support specifying a custom
// engine or application...
if (resolver) {
- return buildOwner(null, resolver);
+ return buildOwner(null, resolver, { rootElement });
}
- return buildOwner(getApplication(), getResolver());
+ return buildOwner(getApplication(), getResolver(), { rootElement });
}).then(owner => {
Object.defineProperty(context, 'owner', {
configurable: true,
diff --git a/dist/setup-rendering-context.js b/dist/setup-rendering-context.js
index af5d0e51473ca68954f75e41f4884171b29b626f..46db315d59c52807fd85b2441b451bfc78900642 100644
--- a/dist/setup-rendering-context.js
+++ b/dist/setup-rendering-context.js
@@ -18,7 +18,7 @@ const EMPTY_TEMPLATE = precompileTemplate("", {
const INVOKE_PROVIDED_COMPONENT = precompileTemplate("<this.ProvidedComponent />", {
strictMode: false
});
-const hasCalledSetupRenderingContext = Symbol();
+export const hasCalledSetupRenderingContext = Symbol('hasCalledSetupRenderingContext');
// Isolates the notion of transforming a TextContext into a RenderingTestContext.
// eslint-disable-next-line require-jsdoc
function prepare(context) {
Loading

0 comments on commit f643e89

Please sign in to comment.