Skip to content

Commit

Permalink
Merge pull request #1920 from embroider-build/new-index-html-format-t…
Browse files Browse the repository at this point in the history
…est-support-js

New `index.html` format - `test-support.js`
  • Loading branch information
mansona committed May 16, 2024
2 parents 1ea1c86 + 1f5a48e commit bdf4aae
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 22 deletions.
4 changes: 0 additions & 4 deletions packages/compat/src/compat-app-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
},
Expand Down Expand Up @@ -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');
}

Expand Down
7 changes: 0 additions & 7 deletions packages/compat/src/compat-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/ember-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -84,7 +83,6 @@ export class PreparedEmberHTML {
implicitScripts: Placeholder;
implicitStyles: Placeholder;
testJavascript: Placeholder;
implicitTestScripts: Placeholder;
implicitTestStyles: Placeholder;

constructor(private asset: EmberAsset) {
Expand All @@ -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);
Expand All @@ -111,7 +106,6 @@ export class PreparedEmberHTML {
this.styles,
this.implicitScripts,
this.implicitStyles,
this.implicitTestScripts,
this.implicitTestStyles,
this.testJavascript,
];
Expand Down
2 changes: 1 addition & 1 deletion test-packages/sample-transforms/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<script src="/testem.js" integrity=""></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion tests/addon-template/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion tests/app-template/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="{{rootURL}}assets/app-template.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/macro-test/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<script src="/@embroider/core/vendor.js"></script>
<script src="{{rootURL}}apple.js"></script>
<script src="{{rootURL}}ordered.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="{{rootURL}}assets/app-template.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion tests/ts-app-template/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<script src="/testem.js" integrity="" data-embroider-ignore></script>
<script src="/@embroider/core/vendor.js"></script>
<script src="{{rootURL}}assets/test-support.js"></script>
<script src="/@embroider/core/test-support.js"></script>
<script src="{{rootURL}}assets/ts-app-template.js"></script>
<script src="{{rootURL}}assets/tests.js"></script>

Expand Down

0 comments on commit bdf4aae

Please sign in to comment.