From 6f57cc20cd4af5bb43f24cd3419b81ec4bc10762 Mon Sep 17 00:00:00 2001 From: Marine Dunstetter Date: Thu, 16 May 2024 11:20:31 +0200 Subject: [PATCH 1/2] tests(new index.html): use the virtual test-support.js in the index.html of all test apps --- test-packages/sample-transforms/tests/index.html | 2 +- tests/addon-template/tests/index.html | 2 +- tests/app-template/tests/index.html | 2 +- tests/fixtures/macro-test/tests/index.html | 2 +- tests/ts-app-template/tests/index.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test-packages/sample-transforms/tests/index.html b/test-packages/sample-transforms/tests/index.html index be6489f6d..ae3012677 100644 --- a/test-packages/sample-transforms/tests/index.html +++ b/test-packages/sample-transforms/tests/index.html @@ -30,7 +30,7 @@ - + diff --git a/tests/addon-template/tests/index.html b/tests/addon-template/tests/index.html index acd07bbbb..5ca2204c7 100644 --- a/tests/addon-template/tests/index.html +++ b/tests/addon-template/tests/index.html @@ -29,7 +29,7 @@ - + diff --git a/tests/app-template/tests/index.html b/tests/app-template/tests/index.html index 0df49a2df..75cae7486 100644 --- a/tests/app-template/tests/index.html +++ b/tests/app-template/tests/index.html @@ -26,7 +26,7 @@ - + diff --git a/tests/fixtures/macro-test/tests/index.html b/tests/fixtures/macro-test/tests/index.html index 149851d9c..f65bdb234 100644 --- a/tests/fixtures/macro-test/tests/index.html +++ b/tests/fixtures/macro-test/tests/index.html @@ -35,7 +35,7 @@ - + diff --git a/tests/ts-app-template/tests/index.html b/tests/ts-app-template/tests/index.html index d88ab7ee4..d7b9e3e3b 100644 --- a/tests/ts-app-template/tests/index.html +++ b/tests/ts-app-template/tests/index.html @@ -29,7 +29,7 @@ - + From 1f5a48e27caa5b733decc1fe5d00decb7dc89b93 Mon Sep 17 00:00:00 2001 From: Marine Dunstetter Date: Thu, 16 May 2024 11:28:34 +0200 Subject: [PATCH 2/2] feat(new index.html): pass the test-support.js entry point from app to rewritten-app --- packages/compat/src/compat-app-builder.ts | 4 ---- packages/compat/src/compat-app.ts | 7 ------- packages/core/src/ember-html.ts | 6 ------ 3 files changed, 17 deletions(-) diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 02a8f736f..aea8cd9aa 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -214,7 +214,6 @@ export class CompatAppBuilder { implicitScripts: this.compatApp.findVendorScript(scripts, entrypoint), implicitStyles: this.compatApp.findVendorStyles(styles, entrypoint), testJavascript: this.compatApp.findTestScript(scripts), - implicitTestScripts: this.compatApp.findTestSupportScript(scripts), implicitTestStyles: this.compatApp.findTestSupportStyles(styles), }; }, @@ -477,9 +476,6 @@ export class CompatAppBuilder { let testJS = this.testJSEntrypoint(appFiles, prepared); html.insertScriptTag(html.testJavascript, testJS.relativePath, { type: 'module' }); - // virtual test-support.js - html.insertScriptTag(html.implicitTestScripts, '@embroider/core/test-support.js'); - html.insertStyleLink(html.implicitTestStyles, '@embroider/core/test-support.css'); } diff --git a/packages/compat/src/compat-app.ts b/packages/compat/src/compat-app.ts index 290adb90f..864b1b146 100644 --- a/packages/compat/src/compat-app.ts +++ b/packages/compat/src/compat-app.ts @@ -757,13 +757,6 @@ export default class CompatApp { ); } - findTestSupportScript(scripts: HTMLScriptElement[]): HTMLScriptElement | undefined { - return scripts.find( - script => - this.withoutRootURL(script.src) === this.legacyEmberAppInstance.options.outputPaths.testSupport.js.testSupport - ); - } - findTestScript(scripts: HTMLScriptElement[]): HTMLScriptElement | undefined { return scripts.find( script => this.withoutRootURL(script.src) === this.legacyEmberAppInstance.options.outputPaths.tests.js diff --git a/packages/core/src/ember-html.ts b/packages/core/src/ember-html.ts index 065443145..73316a9f9 100644 --- a/packages/core/src/ember-html.ts +++ b/packages/core/src/ember-html.ts @@ -22,7 +22,6 @@ export interface EmberHTML { // Do not confuse these with controlling whether or not we will insert tests. // That is separately controlled via `includeTests`. testJavascript?: Node; - implicitTestScripts?: Node; implicitTestStyles?: Node; } @@ -84,7 +83,6 @@ export class PreparedEmberHTML { implicitScripts: Placeholder; implicitStyles: Placeholder; testJavascript: Placeholder; - implicitTestScripts: Placeholder; implicitTestStyles: Placeholder; constructor(private asset: EmberAsset) { @@ -97,9 +95,6 @@ export class PreparedEmberHTML { this.testJavascript = html.testJavascript ? Placeholder.replacing(html.testJavascript) : Placeholder.immediatelyAfter(this.javascript.end); - this.implicitTestScripts = html.implicitTestScripts - ? Placeholder.replacing(html.implicitTestScripts) - : Placeholder.immediatelyAfter(this.implicitScripts.end); this.implicitTestStyles = html.implicitTestStyles ? Placeholder.replacing(html.implicitTestStyles) : Placeholder.immediatelyAfter(this.implicitStyles.end); @@ -111,7 +106,6 @@ export class PreparedEmberHTML { this.styles, this.implicitScripts, this.implicitStyles, - this.implicitTestScripts, this.implicitTestStyles, this.testJavascript, ];