Skip to content
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

[WIP]: upgrade ember-cli to 2.4 #212

Merged
merged 8 commits into from Apr 10, 2017

Conversation

snewcomer
Copy link
Collaborator

@snewcomer snewcomer commented Apr 7, 2017

Here is a WIP to upgrade ember-cli to 2.4

  • obj[key] to set a key, however, need to use Ember.set. One avenue seems to be to also upgrade ember as well as I left it at 1.13.

Failing test - https://github.com/hhff/ember-infinity/blob/master/tests/acceptance/infinity-route-with-embedded-route-test.js#L19

screen shot 2017-04-06 at 4 34 52 pm

ember 1.13 uses obj[key] to set a key, however, need to use Ember.set
let attributes = assign({}, config.APP);
attributes = assign(attributes, attrs); // use defaults, but you can override;
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary? I thought merge was deprecated for assign

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just came from running ember init on 2.4

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh right sorry read this wrong!

@hhff
Copy link
Collaborator

hhff commented Apr 7, 2017

Looks to be a bunch of failing tests on Travis. Are you seeing them locally?

@snewcomer
Copy link
Collaborator Author

@hhff yeah seeing them locally as well. Some have to do with backburner and the likes. This PR was mainly to show trying to upgrade ember-cli to 2.4 and leaving ember where it is at. You mentioned support for 1.10. I wonder if to get the tests passing, we would need to take an approach like this. I haven't been around the ember community long enough to understand how to maintain backwards compat and get all of these tests passing.

@hhff
Copy link
Collaborator

hhff commented Apr 7, 2017

@snewcomer im cool with switching to the ember-power-select way and dropping 1.x! Let's do that!


assert.throws(() => {
try {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert.throws failes after ember 2.11 so wrap try catch. However, this method does not work in the infinity-loader unit test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kk

@@ -88,7 +89,7 @@ test('it uses the provided scrollable element', function(assert) {
assert.equal(scrollable[0], $("#content")[0]);
});

test('it throws error when scrollable element is not found', function(assert) {
skip('it throws error when scrollable element is not found', function(assert) {
assert.expect(1);

this.subject({scrollable: "#nonexistent"});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapping try catch around this only passes after reload of test. Fails on first run though. So assuming state issue. Need to dig further.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tried many solutions here except ember-qunit-assert-helpers sol'n. I need to upgrade the test suite to be able to use this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this error throws in didInsertElement.

Could we try something more specific to that method?

try {
  this.didInsertElement();
} catch

or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant! Yep that worked. pushed

@snewcomer
Copy link
Collaborator Author

snewcomer commented Apr 7, 2017

@hhff yayyy! Here is a passing build tests against 2.4 and above. Used firefox to run the tests on travis as well - seen other addons and apps drop phantom js from their test suite as well. Let me know what you think. Still have a few tests to circle back on (that I skipped) that use assert.throws.

@snewcomer
Copy link
Collaborator Author

snewcomer commented Apr 9, 2017

I'm guessing to get these skipped (infinity-loader unit test) tests to pass I need to upgrade other deps including ember-qunit and potentially changing the acceptance tests to use moduleForAcceptance. Also any thoughts on using mirage or would you like to keep the fake server?

import RouteMixin from 'ember-infinity/mixins/route';
import { module, test } from 'qunit';

module('RouteMixin');

const assign = Ember.assign || Ember.merge;

let EO = Ember.Object.create.bind(Ember.Object);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this failed on test runs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im fine with this!

@hhff hhff merged commit 4dd799c into adopted-ember-addons:master Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants