diff --git a/packages/core/src/module-resolver.ts b/packages/core/src/module-resolver.ts index a14661178..18f2afb5c 100644 --- a/packages/core/src/module-resolver.ts +++ b/packages/core/src/module-resolver.ts @@ -484,9 +484,9 @@ export class Resolver { private handleImplicitTestScripts(request: R): R { //TODO move the extra forwardslash handling out into the vite plugin const candidates = [ - '@embroider/core/test-support.js', - '/@embroider/core/test-support.js', - './@embroider/core/test-support.js', + '@embroider/virtual/test-support.js', + '/@embroider/virtual/test-support.js', + './@embroider/virtual/test-support.js', ]; if (!candidates.includes(request.specifier)) { @@ -496,7 +496,7 @@ export class Resolver { let pkg = this.packageCache.ownerOfFile(request.fromFile); if (pkg?.root !== this.options.engines[0].root) { throw new Error( - `bug: found an import of ${request.specifier} in ${request.fromFile}, but this is not the top-level Ember app. The top-level Ember app is the only one that has support for @embroider/core/test-support.js. If you think something should be fixed in Embroider, please open an issue on https://github.com/embroider-build/embroider/issues.` + `bug: found an import of ${request.specifier} in ${request.fromFile}, but this is not the top-level Ember app. The top-level Ember app is the only one that has support for @embroider/virtual/test-support.js. If you think something should be fixed in Embroider, please open an issue on https://github.com/embroider-build/embroider/issues.` ); } @@ -506,9 +506,9 @@ export class Resolver { private handleTestSupportStyles(request: R): R { //TODO move the extra forwardslash handling out into the vite plugin const candidates = [ - '@embroider/core/test-support.css', - '/@embroider/core/test-support.css', - './@embroider/core/test-support.css', + '@embroider/virtual/test-support.css', + '/@embroider/virtual/test-support.css', + './@embroider/virtual/test-support.css', ]; if (!candidates.includes(request.specifier)) { @@ -518,7 +518,7 @@ export class Resolver { let pkg = this.packageCache.ownerOfFile(request.fromFile); if (pkg?.root !== this.options.engines[0].root) { throw new Error( - `bug: found an import of ${request.specifier} in ${request.fromFile}, but this is not the top-level Ember app. The top-level Ember app is the only one that has support for @embroider/core/test-support.css. If you think something should be fixed in Embroider, please open an issue on https://github.com/embroider-build/embroider/issues.` + `bug: found an import of ${request.specifier} in ${request.fromFile}, but this is not the top-level Ember app. The top-level Ember app is the only one that has support for @embroider/virtual/test-support.css. If you think something should be fixed in Embroider, please open an issue on https://github.com/embroider-build/embroider/issues.` ); } diff --git a/packages/vite/src/resolver.ts b/packages/vite/src/resolver.ts index 7b3211d86..99cb56303 100644 --- a/packages/vite/src/resolver.ts +++ b/packages/vite/src/resolver.ts @@ -89,7 +89,7 @@ export function resolver(): Plugin { }); this.emitFile({ type: 'asset', - fileName: '@embroider/core/test-support.js', + fileName: '@embroider/virtual/test-support.js', source: virtualContent( resolve(resolverLoader.resolver.options.engines[0].root, '-embroider-test-support.js'), resolverLoader.resolver diff --git a/tests/addon-template/tests/index.html b/tests/addon-template/tests/index.html index 3a4e7d968..4499381f8 100644 --- a/tests/addon-template/tests/index.html +++ b/tests/addon-template/tests/index.html @@ -11,7 +11,7 @@ - + {{content-for "head-footer"}} {{content-for "test-head-footer"}} @@ -29,7 +29,7 @@ - + - + - + - + - +