diff --git a/addon-test-support/@ember/test-helpers/-internal/build-registry.ts b/addon-test-support/@ember/test-helpers/-internal/build-registry.ts index 7bb88ecd8..72b7841e2 100644 --- a/addon-test-support/@ember/test-helpers/-internal/build-registry.ts +++ b/addon-test-support/@ember/test-helpers/-internal/build-registry.ts @@ -1,11 +1,9 @@ -/* globals global, requirejs */ - import Resolver from '@ember/application/resolver'; import ApplicationInstance from '@ember/application/instance'; import Application from '@ember/application'; import EmberObject from '@ember/object'; -import require from 'require'; +import require, { has } from 'require'; import Ember from 'ember'; /** @@ -91,7 +89,7 @@ export default function (resolver: Resolver) { exposeRegistryMethodsWithoutDeprecations(container); - if ((requirejs as any).entries['ember-data/setup-container']) { + if (has('ember-data/setup-container')) { // ember-data is a proper ember-cli addon since 2.3; if no 'import // 'ember-data'' is present somewhere in the tests, there is also no `DS` // available on the globalContext and hence ember-data wouldn't be setup diff --git a/types/require.d.ts b/types/require.d.ts index 0295f4234..c060d7c3e 100644 --- a/types/require.d.ts +++ b/types/require.d.ts @@ -1 +1,2 @@ export default function (moduleName: string): T; +export function has(moduleName: string): T;