-
Notifications
You must be signed in to change notification settings - Fork 90
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
Move all assets to test-support.js instead of vendor.js #399
Conversation
index.js
Outdated
// TODO: In order to make the addon work in EmberTwiddle, we cannot use // the `tests` prop til | ||
// https://github.com/joostdevries/twiddle-backend/pull/28 is merged. | ||
// return !!this.app.tests; | ||
|
||
if(process.env && process.env.EMBER_CLI_FASTBOOT) { |
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.
Btw, this was used in pre-stable versions of FastBoot, but isn't a thing anymore for a while, so removed it.
|
||
describe('#treeFor app', function() { | ||
treeForTests('app'); | ||
}); |
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.
Removed these tests (which were failing before), because I think they don't really apply anymore. app
and addon
are always empty now, and for addon-test-support
there's no need for conditional logic anymore as it is only used in tests anyway.
Thanks @simonihmig for working on this! As you said we have to test this change to validate there are not regressions. I'll test it on some small projects I have but it would be great if @magistrula and others that have big test suites can test it as well. |
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 like it. This change allows ember-cli-page-object
to be more similar to the rest of existing testing addons.
I believe we still have to change API paths for the docs generator as well:
Line 265 in e53564e
globs: ['addon/-private/{create.js,properties/*.js}' ] |
index.js
Outdated
}); | ||
}, | ||
|
||
_shouldIncludeFiles() { |
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 _shouldIncludeFiles
was previously needed to exclude ember-cli-page-object
assets from the prod builds. Now it should be handled by ember-cli
since test-support
stuff is not included to the prod builds. So I'd say we can remove it.
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.
Yeah, good catch. Makes sense!
@simonihmig I've just merged docs updates which produced conflicts in your PR 😫 Sorry for not merging it earlier. Can you please resolve conflicts? |
Hm.. Seems like |
81b9a80
to
801d0f9
Compare
801d0f9
to
b84e504
Compare
Thanks for the quick feedback! I rebased this, and cleaned this up a bit further.
I updated this line, but as I am not aware how that works, please double check...
Absolutely! I reran the latest changes on one of our apps, and its 1700+ tests (all included) are still all passing.
Sorry, I have no idea how that works! 😝 Also wondered how coverage could have changed significantly. Anything I can do on my side to fix this? |
Looks like it should be fixed in the latest of ember-cli-code-coverage. I think we just have to upgrade it. |
I've just tried |
@simonihmig FYI I'm currently working on the code coverage issue on top of your branch. The issue is caused by the fact that wip branch: https://github.com/ro0gr/ember-cli-page-object/commits/addon-test-support-coverage |
@ro0gr Hm, I see. Thanks for working on this, and for giving feedback! Hope it works out somehow! |
@simonihmig just merged #400. Thanks for the great idea! |
@ro0gr Sure, thanks for picking this up and getting it across the finish line! :) |
This fixes #397 and also implements the other changes suggested there: All (own and imported) JS is moved from
vendor.js
totest-support.js
. The repo's code is now in theaddon-test-support
tree, and the trickery intreeForAddonTestSupport()
(shamelessly stolen fromember-native-dom-helpers
) makes sure the imports have not changed (i.e. notest-support/
path added to imports).I tried this fork with a large app, and was working fine. Didn't have to update anything (except
package.json
), and all still working. I hope I am not missing something though, so please double check if these changes make sense for you! :)