Skip to content

Commit

Permalink
update core resolver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Sep 20, 2024
1 parent 19ab9db commit 00bdcd2
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions tests/scenarios/core-resolver-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const { module: Qmodule, test } = QUnit;

Scenarios.fromProject(() => new Project())
.map('core-resolver-test', app => {
app.linkDevDependency('ember-source', { baseDir: __dirname });

let appMeta: AppMeta = {
type: 'app',
version: 2,
Expand Down Expand Up @@ -182,6 +184,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../hello-world.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'hello-world'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import component from "../../../components/hello-world.js";
export default setComponentTemplate(template, component);
`);
Expand All @@ -206,6 +223,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../hello-world.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'hello-world'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import templateOnlyComponent from "@ember/component/template-only";
export default setComponentTemplate(template, templateOnlyComponent(undefined, "hello-world"));
`);
Expand Down Expand Up @@ -304,6 +336,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../template.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'template'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import templateOnlyComponent from "@ember/component/template-only";
export default setComponentTemplate(template, templateOnlyComponent(undefined, "template"));
`);
Expand All @@ -327,6 +374,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../template.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'template'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import templateOnlyComponent from "@ember/component/template-only";
export default setComponentTemplate(template, templateOnlyComponent(undefined, "template"));
`);
Expand All @@ -351,6 +413,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../template.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'template'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import component from "../component.js";
export default setComponentTemplate(template, component);
`);
Expand All @@ -376,6 +453,21 @@ Scenarios.fromProject(() => new Project())
pairModule.codeEquals(`
import { setComponentTemplate } from "@ember/component";
import template from "../template.hbs";
import { deprecate } from "@ember/debug";
deprecate(
"Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup 'template'.",
false,
{
id: "component-template-resolving",
url: "https://deprecations.emberjs.com/id/component-template-resolving",
until: "6.0.0",
for: "ember-source",
since: {
available: "5.10.0",
enabled: "5.10.0",
},
}
);
import component from "../component.js";
export default setComponentTemplate(template, component);
`);
Expand Down

0 comments on commit 00bdcd2

Please sign in to comment.