Skip to content

Commit

Permalink
Use @embroider/test-setup and get embroider passing
Browse files Browse the repository at this point in the history
  • Loading branch information
thoov committed Feb 16, 2021
1 parent 005bba7 commit 1984a46
Show file tree
Hide file tree
Showing 5 changed files with 764 additions and 335 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
- ember-default-with-jquery
- ember-default-with-mocha
- ember-classic
- embroider
- embroider-with-mocha
- embroider-safe
- embroider-safe-with-mocha
- embroider-optimized
- embroider-optimized-with-mocha
- ember-lts-3.20
Expand Down
43 changes: 13 additions & 30 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

const command = [
'ember',
Expand Down Expand Up @@ -94,48 +95,30 @@ module.exports = async function() {
}
}
},
{
name: 'embroider',
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
},
embroiderSafe(),
embroiderSafe({
name: 'embroider-safe-with-mocha',
env: {
EMBROIDER_TEST_SETUP_OPTIONS: 'safe'
},
},
{
name: 'embroider-with-mocha',
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
'ember-mocha': '*',
},
},
},
{
name: 'embroider-optimized',
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
},
}
},
{
}),
embroiderOptimized(),
embroiderOptimized({
name: 'embroider-optimized-with-mocha',
env: {
EMBROIDER_TEST_SETUP_OPTIONS: 'optimized'
},
npm: {
devDependencies: {
'@embroider/core': '*',
'@embroider/webpack': '*',
'@embroider/compat': '*',
'ember-mocha': '*',
},
}
}
}),
]
};
};
28 changes: 2 additions & 26 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,6 @@ module.exports = function(defaults) {
// Add options here
});

/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/

// Use embroider if it's present (it can get added by ember-try)
if ('@embroider/core' in app.dependencies()) {
/* eslint-disable node/no-missing-require, node/no-extraneous-require */
const { Webpack } = require('@embroider/webpack');
const { compatBuild } = require('@embroider/compat');
/* eslint-enable node/no-missing-require, node/no-extraneous-require */
let config = {};
if (process.env.EMBER_TRY_SCENARIO === 'embroider-optimized') {
config = {
staticAddonTrees: true,
staticAddonTestSupportTrees: true,
staticHelpers: true,
staticComponents: true,
}
}
return compatBuild(app, Webpack, config);
} else {
return app.toTree();
}
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app);
};
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
]
},
"dependencies": {
"@embroider/macros": "^0.29.0",
"@embroider/macros": "^0.36.0",
"chalk": "^4.1.0",
"cli-table3": "^0.6.0",
"debug": "^4.2.0",
Expand All @@ -53,6 +53,8 @@
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.0",
"@embroider/test-setup": "^0.36.0",
"babel-eslint": "^10.1.0",
"codeclimate-test-reporter": "^0.5.0",
"ember-cli": "^3.21.2",
Expand All @@ -70,7 +72,7 @@
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.1",
"ember-qunit": "^4.6.0",
"ember-qunit": "^5.1.2",
"ember-resolver": "^8.0.2",
"ember-source": "~3.21.3",
"ember-source-channel-url": "^1.1.0",
Expand All @@ -86,15 +88,18 @@
"mocha-eslint": "^6.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"qunit": "^2.14.0",
"release-it": "^14.0.2",
"release-it-lerna-changelog": "^2.4.0",
"rsvp": "^4.8.5",
"sinon": "^9.1.0",
"testdouble": "^3.16.1"
},
"peerDependencies": {
"@ember/test-helpers": "*",
"ember-mocha": "*",
"ember-qunit": "*"
"ember-qunit": "*",
"qunit": "*"
},
"peerDependenciesMeta": {
"ember-mocha": {
Expand Down
Loading

0 comments on commit 1984a46

Please sign in to comment.