Skip to content

Commit b49030f

Browse files
committed
reduce patch size
1 parent cd7ad62 commit b49030f

File tree

2 files changed

+25
-104
lines changed

2 files changed

+25
-104
lines changed

patches/@ember__test-helpers@3.3.0.patch

+3-82
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,15 @@ index f5581db0b593755de4aac0741a75ca947325e152..d7a978bd5e9aa42b26a0181b50958a0d
2323
if (!resolver) {
2424
throw new Error('You must set up the ember-test-helpers environment with either `setResolver` or `setApplication` before running any tests.');
2525
diff --git a/addon-test-support/@ember/test-helpers/build-owner.ts b/addon-test-support/@ember/test-helpers/build-owner.ts
26-
index 4123927cf9953a31dc6f2a476a3919a3511c4301..2a6d7f37e40637bb4df5ef1f638a22b740061108 100644
26+
index 4123927cf9953a31dc6f2a476a3919a3511c4301..e9869859c612cd88e2b3ab5f1d2dbbdbbfc3e00e 100644
2727
--- a/addon-test-support/@ember/test-helpers/build-owner.ts
2828
+++ b/addon-test-support/@ember/test-helpers/build-owner.ts
29-
@@ -39,14 +39,18 @@ export interface Owner extends EmberOwner {
30-
*/
31-
export default function buildOwner(
32-
application: Application | undefined | null,
33-
- resolver: Resolver | undefined | null
34-
+ resolver: Resolver | undefined | null,
35-
+ options?: { rootElement?: string | HTMLElement }
36-
): Promise<Owner> {
37-
if (application) {
38-
// @ts-ignore: this type is correct and will check against Ember 4.12 or 5.1
29+
@@ -46,7 +46,7 @@ export default function buildOwner(
3930
// or later. However, the first round of preview types in Ember 4.8 does not
4031
// include the `visit` API (it was missing for many years!) and therefore
4132
// there is no way to make this assignable accross all supported versions.
4233
- return application.boot().then((app) => app.buildInstance().boot());
43-
+ return application.boot(options).then((app) => {
44-
+ const promise = app.buildInstance().boot();
45-
+ return promise;
46-
+ });
34+
+ return application.boot(options).then((app) => app.buildInstance().boot());
4735
}
4836

4937
if (!resolver) {
@@ -60,19 +48,6 @@ index 51b66ee9c663de864efa3822db874e7f317a0b31..13d50d4dad24406999985bc699cf0dd9
6048
export { default as rerender } from './rerender';
6149
export { default as setupApplicationContext, visit, currentRouteName, currentURL } from './setup-application-context';
6250
export { default as settled, isSettled, getSettledState } from './settled';
63-
diff --git a/addon-test-support/@ember/test-helpers/index.ts b/addon-test-support/@ember/test-helpers/index.ts
64-
index c547d687ea9afe086c4568e6de5cf08ed119fe43..9ba28a1feebbef7cb17d76230b79d3f4e275e3a9 100644
65-
--- a/addon-test-support/@ember/test-helpers/index.ts
66-
+++ b/addon-test-support/@ember/test-helpers/index.ts
67-
@@ -32,7 +32,7 @@ export {
68-
render,
69-
clearRender,
70-
} from './setup-rendering-context';
71-
-export type { RenderingTestContext } from './setup-rendering-context';
72-
+export type { RenderingTestContext, hasCalledSetupRenderingContext } from './setup-rendering-context';
73-
export { default as rerender } from './rerender';
74-
export {
75-
default as setupApplicationContext,
7651
diff --git a/addon-test-support/@ember/test-helpers/setup-context.js b/addon-test-support/@ember/test-helpers/setup-context.js
7752
index c68ef11c92225725c8e8eb2b824c787c5644ec8b..84ae96cb4c9aa89d480698e20212df7b6d8331ef 100644
7853
--- a/addon-test-support/@ember/test-helpers/setup-context.js
@@ -99,47 +74,6 @@ index c68ef11c92225725c8e8eb2b824c787c5644ec8b..84ae96cb4c9aa89d480698e20212df7b
9974
}).then(owner => {
10075
associateDestroyableChild(context, owner);
10176
Object.defineProperty(context, 'owner', {
102-
diff --git a/addon-test-support/@ember/test-helpers/setup-context.ts b/addon-test-support/@ember/test-helpers/setup-context.ts
103-
index 2fe7d20979cb4f853e6cd150d4dbc2e4c7596eab..ef5e6d676e4711dfa7dd7635eaf227a28dbee9b8 100644
104-
--- a/addon-test-support/@ember/test-helpers/setup-context.ts
105-
+++ b/addon-test-support/@ember/test-helpers/setup-context.ts
106-
@@ -36,6 +36,7 @@ import {
107-
108-
export interface SetupContextOptions {
109-
resolver?: Resolver | undefined;
110-
+ rootElement?: string | HTMLElement;
111-
}
112-
113-
// This handler exists to provide the underlying data to enable the following methods:
114-
@@ -402,12 +403,14 @@ export default function setupContext<T extends object>(
115-
.then(() => {
116-
let application = getApplication();
117-
if (application) {
118-
+ // never reuse the same application instance between tests
119-
+ application._bootPromise = null;
120-
return application.boot().then(() => {});
121-
}
122-
return;
123-
})
124-
.then(() => {
125-
- let { resolver } = options;
126-
+ let { resolver, rootElement } = options;
127-
128-
// This handles precedence, specifying a specific option of
129-
// resolver always trumps whatever is auto-detected, then we fallback to
130-
@@ -416,10 +419,10 @@ export default function setupContext<T extends object>(
131-
// At some later time this can be extended to support specifying a custom
132-
// engine or application...
133-
if (resolver) {
134-
- return buildOwner(null, resolver);
135-
+ return buildOwner(null, resolver, { rootElement });
136-
}
137-
138-
- return buildOwner(getApplication(), getResolver());
139-
+ return buildOwner(getApplication(), getResolver(), { rootElement });
140-
})
141-
.then((owner) => {
142-
associateDestroyableChild(context, owner);
14377
diff --git a/addon-test-support/@ember/test-helpers/setup-rendering-context.js b/addon-test-support/@ember/test-helpers/setup-rendering-context.js
14478
index fe5b40b8d2eff73de9c5b5ad18f8c0c70e264b6b..b821daa5929dcc6c05a51f7c98185fd0af9b549e 100644
14579
--- a/addon-test-support/@ember/test-helpers/setup-rendering-context.js
@@ -154,19 +88,6 @@ index fe5b40b8d2eff73de9c5b5ad18f8c0c70e264b6b..b821daa5929dcc6c05a51f7c98185fd0
15488
// Isolates the notion of transforming a TextContext into a RenderingTestContext.
15589
// eslint-disable-next-line require-jsdoc
15690
function prepare(context) {
157-
diff --git a/addon-test-support/@ember/test-helpers/setup-rendering-context.ts b/addon-test-support/@ember/test-helpers/setup-rendering-context.ts
158-
index a6ab4cd587d8bbc6d4cb51f6b1cd52daf774f901..965786177e07c7dc7584e0f945d8d9b7bd2f5984 100644
159-
--- a/addon-test-support/@ember/test-helpers/setup-rendering-context.ts
160-
+++ b/addon-test-support/@ember/test-helpers/setup-rendering-context.ts
161-
@@ -23,7 +23,7 @@ const OUTLET_TEMPLATE = hbs`{{outlet}}`;
162-
const EMPTY_TEMPLATE = hbs``;
163-
const INVOKE_PROVIDED_COMPONENT = hbs`<this.ProvidedComponent />`;
164-
165-
-const hasCalledSetupRenderingContext = Symbol();
166-
+export const hasCalledSetupRenderingContext = Symbol('hasCalledSetupRenderingContext');
167-
168-
export interface RenderingTestContext extends TestContext {
169-
element: Element | Document;
17091
diff --git a/dist-types/index.d.ts b/dist-types/index.d.ts
17192
index fe2bd64a876f41b9d270e49ca8c8d53b5d3000b6..54a5b34130063c22f1bb70bc02a0569892415e8b 100644
17293
--- a/dist-types/index.d.ts

pnpm-lock.yaml

+22-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)