-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support Ember apps that remove jquery. #58
Conversation
@@ -153,6 +153,11 @@ module.exports = { | |||
} | |||
}, | |||
|
|||
included: function(app) { | |||
this._super.included(app); | |||
app.import('vendor/percy-jquery.js', {type: 'test'}); |
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.
Need to think about this slightly more — we technically support people right now exporting PERCY_TOKEN in development mode, running ember server
(instead of ember test
) and navigating to /tests and getting snapshots. I don't think that's a common flow or one we care to support, but need to think slightly more about this.
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.
So this will break the ability to go to localhost:whatever/tests
? Or only getting percy snapshots locally through localhost:whatever/tests
?
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.
Only getting percy snapshots when running /tests locally, which I don't think anyone does.
@@ -153,6 +153,11 @@ module.exports = { | |||
} | |||
}, | |||
|
|||
included: function(app) { | |||
this._super.included(app); | |||
app.import('vendor/percy-jquery.js', {type: 'test'}); |
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.
So this will break the ability to go to localhost:whatever/tests
? Or only getting percy snapshots locally through localhost:whatever/tests
?
assert.equal(currentURL(), '/'); | ||
percySnapshot('dupe test'); | ||
// Test duplicate name (should log warning and skip this snapshot): | ||
percySnapshot('dupe test'); |
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.
How do we know the snapshot is skipped instead of overwritten? Maybe it doesn't matter? I guess I always assumed it was just overwritten...
We also are not testing the log output so not sure if this test is useful?
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.
Per discussion, this is a regression test for making sure that dupe tests are handled correctly. Yeah it could be more thoroughly tested via log output, but there are many places in ember-percy where we integration test things anyway.
Have tested this with https://github.com/percy/percy-web, all 👍 |
Released in v1.4.0. |
Support Ember apps that remove jquery like this:
https://shipshape.io/blog/ember-without-jquery/
Remain 100% backwards compatible with current addon behavior, but allow Ember apps to strip jquery from their production builds. We do this by including a vendorized version of jquery (percy-jquery.js), and only loading it into ember apps in test mode. This makes ember-percy keeps its exact same behavior, but allow users to strip jquery. Long-term we can remove each dependency on jquery over time when we're sure we can safely replicate the behaviors of things like
.clone()
and such.While we're at it, also upgrade this addon's own tests to the new format to make sure we're compatible with modern non-jquery based test helpers.