Skip to content

Commit f644ede

Browse files
NullVoxPopuliclaude
andcommitted
Remove this.compile() usage from test files
- life-cycle-test: use template() from @ember/template-compiler/runtime instead of this.compile() for setting component templates - template-factory-test: import compile directly from internal path (this test specifically tests TemplateFactory behavior) - multiple-app-test: import compile directly from internal path (registers route templates needing TemplateFactory) No test files call this.compile() anymore — it's now purely an internal implementation detail of the test case base classes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 70ceeef commit f644ede

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/@ember/-internals/glimmer/tests/integration/components/life-cycle-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { A as emberA } from '@ember/array';
66
import { getViewElement, getViewId } from '@ember/-internals/views';
77
import { precompileTemplate } from '@ember/template-compilation';
88
import { setComponentTemplate } from '@glimmer/manager';
9+
import { template as runtimeTemplate } from '@ember/template-compiler/runtime';
910

1011
import { Component } from '../../utils/helpers';
1112

@@ -289,7 +290,7 @@ class LifeCycleHooksTest extends RenderingTestCase {
289290
};
290291

291292
if (typeof template === 'string') {
292-
setComponentTemplate(this.compile(template), ComponentClass);
293+
runtimeTemplate(template, { component: ComponentClass, strictMode: false });
293294
}
294295
this.owner.register(`component:${name}`, ComponentClass);
295296
}

packages/@ember/-internals/glimmer/tests/unit/template-factory-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ENV } from '@ember/-internals/environment';
22
import { RenderingTestCase, moduleFor } from 'internal-test-helpers';
3+
import compile from 'internal-test-helpers/lib/compile';
34

45
import { template, templateCacheCounters } from '@ember/-internals/glimmer';
56
import { precompile } from 'ember-template-compiler';
@@ -23,7 +24,7 @@ moduleFor(
2324
let exports = {};
2425
module(exports, template);
2526
let Precompiled = exports['default'];
26-
let Compiled = this.compile('Hello {{this.name}}', options);
27+
let Compiled = compile('Hello {{this.name}}', options);
2728

2829
assert.equal(typeof Precompiled, 'function', 'precompiled is a factory');
2930
assert.equal(typeof Compiled, 'function', 'compiled is a factory');

packages/ember/tests/integration/multiple-app-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { moduleFor, ApplicationTestCase, runTask } from 'internal-test-helpers';
2+
import compile from 'internal-test-helpers/lib/compile';
23
import Application from '@ember/application';
34
import { Component } from '@ember/-internals/glimmer';
45
import { getOwner } from '@ember/-internals/owner';
@@ -66,7 +67,7 @@ moduleFor(
6667

6768
resolver.add(
6869
'template:index',
69-
this.compile(
70+
compile(
7071
`
7172
<h1>Node 1</h1>{{special-button}}
7273
`

0 commit comments

Comments
 (0)