File tree Expand file tree Collapse file tree 5 files changed +19
-28
lines changed
Expand file tree Collapse file tree 5 files changed +19
-28
lines changed Original file line number Diff line number Diff line change 11import setupMirage from './setup-mirage' ;
22export { setupMirage } ;
33
4- import { dependencySatisfies } from '@embroider/macros' ;
5-
6- if ( dependencySatisfies ( 'ember-qunit' , '*' ) ) {
4+ if ( typeof window . QUnit !== 'undefined' ) {
75 window . QUnit . config . urlConfig . push ( {
86 id : 'mirageLogging' ,
97 label : 'Mirage logging' ,
Original file line number Diff line number Diff line change 11import { deprecate } from '@ember/debug' ;
2- import { importSync , isTesting , dependencySatisfies } from '@embroider/macros ' ;
2+ import require from 'require ' ;
33import * as mirage from 'miragejs' ;
44import * as ecMirageExports from './index' ;
55
@@ -15,8 +15,8 @@ export function initDeprecatedReExports() {
1515 // eslint-disable-next-line no-import-assign
1616 Object . defineProperty ( ecMirageExports , name , {
1717 get ( ) {
18- if ( isTesting ( ) && dependencySatisfies ( 'ember-qunit' , '* ') ) {
19- const { waitUntil, getContext } = importSync ( '@ember/test-helpers' ) ;
18+ if ( require . has ( 'ember-qunit' ) ) {
19+ const { waitUntil, getContext } = require ( '@ember/test-helpers' ) ;
2020
2121 window . QUnit . begin ( function ( ) {
2222 // Make sure deprecation message does not get "swallowed"
Original file line number Diff line number Diff line change 1- import { importSync , dependencySatisfies , isTesting } from '@embroider/macros ' ;
1+ import require from 'require ' ;
22
33/**
44 Helper to get our rfc232/rfc268 test context object, or null if we're not in
@@ -10,8 +10,8 @@ export default function getRfc232TestContext() {
1010 // Support older versions of `ember-qunit` that don't have
1111 // `@ember/test-helpers` (and therefore cannot possibly be running an
1212 // rfc232/rfc268 test).
13- if ( dependencySatisfies ( '@ember/test-helpers' , '*' ) && isTesting ( ) ) {
14- let { getContext } = importSync ( '@ember/test-helpers' ) ;
13+ if ( require . has ( '@ember/test-helpers' ) ) {
14+ let { getContext } = require ( '@ember/test-helpers' ) ;
1515 return getContext ( ) ;
1616 }
1717}
Original file line number Diff line number Diff line change 1- import { dependencySatisfies } from '@embroider/macros' ;
1+ /* global requirejs */
2+
3+ function _hasEmberData ( ) {
4+ let matchRegex1 = / ^ e m b e r - d a t a / i;
5+ let matchRegex2 = / ^ @ e m b e r - d a t a / i;
6+
7+ return ! ! Object . keys ( requirejs . entries ) . find (
8+ ( e ) => ! ! e . match ( matchRegex2 ) || ! ! e . match ( matchRegex1 )
9+ ) ;
10+ }
211
312/**
413 @hide
514*/
6- export const hasEmberData = dependencySatisfies ( 'ember-data' , '*' ) ;
15+ export const hasEmberData = _hasEmberData ( ) ;
716
817/**
918 @hide
Original file line number Diff line number Diff line change 4040 "prepare" : " ./scripts/link.sh"
4141 },
4242 "dependencies" : {
43- "@embroider/macros" : " ^0.41.0" ,
4443 "broccoli-file-creator" : " ^2.1.1" ,
4544 "broccoli-funnel" : " ^3.0.3" ,
4645 "broccoli-merge-trees" : " ^4.2.0" ,
5251 "lodash-es" : " ^4.17.11" ,
5352 "miragejs" : " ^0.1.43"
5453 },
55- "peerDependencies" : {
56- "@ember/test-helpers" : " *" ,
57- "ember-data" : " *" ,
58- "ember-qunit" : " *"
59- },
60- "peerDependenciesMeta" : {
61- "@ember/test-helpers" : {
62- "optional" : true
63- },
64- "ember-data" : {
65- "optional" : true
66- },
67- "ember-qunit" : {
68- "optional" : true
69- }
70- },
7154 "devDependencies" : {
7255 "@ember/jquery" : " ^2.0.0" ,
7356 "@ember/optional-features" : " ^2.0.0" ,
7457 "@ember/test-helpers" : " ^2.6.0" ,
58+ "@embroider/macros" : " ^0.41.0" ,
7559 "@embroider/test-setup" : " ^0.41.0" ,
7660 "@glimmer/component" : " ^1.0.4" ,
7761 "@glimmer/tracking" : " ^1.0.4" ,
You can’t perform that action at this time.
0 commit comments