Skip to content

Commit a689272

Browse files
authored
Replace require('@ember/service') with service property (#10977)
`require()` is no longer available starting with Ember.js v6.1.0.
1 parent a66e6bc commit a689272

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/services/testing.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { setTesting } from '@ember/debug';
22
import Service from '@ember/service';
33

44
export default class extends Service {
5+
Service = Service;
6+
57
setTesting(value) {
68
// This indirection is needed for playwright to be able to use the `setTesting()` fn of `@ember/debug`.
79
setTesting(value);

e2e/routes/support.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test.describe('Route | support', { tag: '@routes' }, () => {
2727

2828
test('LinkTo support must overwirte query', async ({ page, ember }) => {
2929
await ember.addHook(async owner => {
30-
const Service = require('@ember/service').default;
30+
const { Service } = owner.lookup('service:testing');
3131
// query params of LinkTo support's in footer will not be cleared
3232
class MockService extends Service {
3333
paramsFor() {

0 commit comments

Comments
 (0)