-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embroider ember-try scenarios #308
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,22 @@ | |
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); | ||
|
||
module.exports = function (defaults) { | ||
let app = new EmberAddon(defaults, { | ||
autoImport: { | ||
exclude: ['qunit'], | ||
}, | ||
}); | ||
|
||
app.import('node_modules/qunit/qunit/qunit.js', { | ||
type: 'test', | ||
}); | ||
let app = new EmberAddon(defaults); | ||
|
||
app.import('node_modules/qunit/qunit/qunit.css', { | ||
type: 'test', | ||
}); | ||
|
||
app.import('vendor/shims/qunit.js', { type: 'test' }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use auto-import instead |
||
|
||
return app.toTree(); | ||
try { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is verbose, because this library cannot yet drop node 10 and instead requires |
||
const { maybeEmbroider } = require('@embroider/test-setup'); // eslint-disable-line node/no-missing-require | ||
return maybeEmbroider(app); | ||
} catch (e) { | ||
// This exists, so that we can continue to support node 10 for some of our | ||
// test scenarios. Specifically those not scenario testing embroider. As | ||
// @embroider/test-setup and @embroider in no longer supports node 10 | ||
if (e !== null && typeof e === 'object' && e.code === 'MODULE_NOT_FOUND') { | ||
return app.toTree(); | ||
} | ||
throw e; | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,6 @@ | |
"ember-source": "~3.24.1", | ||
"ember-source-channel-url": "^3.0.0", | ||
"ember-try": "^1.4.0", | ||
"es6-promise": "^4.2.8", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-ember": "^7.8.1", | ||
|
@@ -85,6 +84,7 @@ | |
"loader.js": "^4.7.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.2.1", | ||
"promise-polyfill": "^8.2.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"qunit": "^2.16.0", | ||
"release-it": "^14.11.5", | ||
"release-it-lerna-changelog": "^3.1.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars | ||
/* global runningTests: true */ | ||
|
||
/* | ||
used to determine if the application should be booted immediately when `app-name.js` is evaluated | ||
when `runningTests` the `app-name.js` file will **not** import the applications `app/app.js` and | ||
call `Application.create(...)` on it. Additionally, applications can opt-out of this behavior by | ||
setting `autoRun` to `false` in their `ember-cli-build.js` | ||
*/ | ||
runningTests = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mimic |
||
/* | ||
This file overrides a file built into ember-cli's build pipeline and prevents | ||
this built-in `Testem.hookIntoTestFramework` invocation: | ||
|
||
https://github.com/ember-cli/ember-cli/blob/v3.20.0/lib/broccoli/test-support-suffix.js#L3-L5 | ||
*/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ | |
{{content-for "test-body"}} | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
|
||
<div id="ember-testing-container"> | ||
<div id="ember-testing"></div> | ||
<div id="qunit-fixture"> | ||
<div id="ember-testing-container"> | ||
<div id="ember-testing"></div> | ||
</div> | ||
</div> | ||
|
||
<script src="/testem.js" integrity=""></script> | ||
<script src="/testem.js" integrity="" data-embroider-ignore></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ensures embroider doesn't warn that it can't find this, as this is a dynamic files provided by a middleware which shouldn't and cannot be bundled. |
||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/test-support.js"></script> | ||
<script src="{{rootURL}}assets/dummy.js"></script> | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this, if we include qunit via auto-import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason we had this here was that we weren't sure of broad auto-import support at the time of writing. Makes sense if it's better supported now.