Skip to content

Commit

Permalink
Drop ember-qunit support below v5
Browse files Browse the repository at this point in the history
The scenario wasn't working with ember-cli@5 and ember-qunit has been out
for a while.
  • Loading branch information
andreyfel committed Dec 29, 2023
1 parent 15538f9 commit b760205
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 35 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
- ember-release
- ember-beta
- ember-canary
- ember-qunit-4

steps:
- uses: actions/checkout@v2
Expand Down
25 changes: 1 addition & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

'use strict';

const VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: require('./package').name,

Expand All @@ -13,30 +11,9 @@ module.exports = {

init() {
this._super.init.apply(this, arguments);
let versionChecker = new VersionChecker(this.project);

const hasMagicallyProvidedQUnit = versionChecker
.for('ember-qunit')
.lt('5.0.0-beta.1');

let options = {
this.options.autoImport = {
exclude: ['ember-mocha', 'mocha'],
};

// Ember-qunit < 5 provides an AMD shim for qunit but newer versions now use
// ember-auto-import to include qunit. This means that qunit is no
// longer available for addons (if the parent app is using ember-qunit > 5) to
// directly import under embroider unless they are using ember-auto-import
// themselves. This condidionally falls back to not using ember-auto-import
// when the parent app is providing qunit because without this we would double
// include qunit resulting in a runtime error (qunit detects if it as
// already be added to the window object and errors if so).
if (hasMagicallyProvidedQUnit) {
this.options = this.options || {};
options.exclude.push('qunit');
this.options.autoImport = options;
} else {
this.options.autoImport = options;
}
},
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"debug": "^4.2.0",
"ember-auto-import": "^2.7.0",
"ember-cli-babel": "^8.2.0",
"ember-cli-version-checker": "^5.1.2",
"execa": "^8.0.1",
"fs-extra": "^11.2.0",
"js-yaml": "^4.0.0",
Expand Down
9 changes: 0 additions & 9 deletions tests/dummy/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,6 @@ module.exports = async function () {
name: 'embroider-optimized-with-mocha',
}),
),
{
name: 'ember-qunit-4',
npm: {
devDependencies: {
'ember-qunit': '^4.6.0',
'ember-source': '^3.28.0',
},
},
},
],
};
};

0 comments on commit b760205

Please sign in to comment.