Skip to content

Migrate acceptance tests to use destroy-app helper - #84

Merged
abuiles merged 1 commit into
abuiles:masterfrom
blimmer:destroy-app-helper
Sep 21, 2015
Merged

abuiles merged 1 commit into
abuiles:masterfrom
blimmer:destroy-app-helper

Conversation

@blimmer

@blimmer blimmer commented Sep 20, 2015

Copy link
Copy Markdown
Contributor

The next version of Ember CLI will have a new destroy app helper, similiar to the start-app helper that already exists. I want to write a migrator to help automatically move everyone over to this new syntax.

Additionally, I link to a place where users can learn how to create this helper and use it before they're able to upgrade to Ember CLI 1.13.9 (yet to be released).

Introduced in Ember CLI 1.13.9.
@blimmer blimmer changed the title [WIP] supporting a destroy-app helper. Migrate acceptance tests to use destroy-app helper Sep 21, 2015
@rwjblue

rwjblue commented Sep 21, 2015

Copy link
Copy Markdown
Contributor

Just a note: using this.application = startApp() (vs just using a local variable) was only changed a version or two ago.

If the test in question does not use this.application = startApp() (it is using application = startApp() instead), should we update the usage to the new format?

@blimmer

blimmer commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

@rwjblue I wonder if that should be covered in the more generic qunit transforms rather than here?

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@blimmer thanks for this! Probably we can add it here? The old transform was to help people migrate to QUnit 2 syntax.

@blimmer

blimmer commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

I just worry that that introduces pretty big scope creep to this story. Changing that would also mean that we would have to parse the rest of the file to ensure we change any other references to this.application to application to ensure we don't break people's tests. That change feels different from the goal of this formula.

That said, if you guys disagree, I can take a look at adding that functionality as time permits.

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@blimmer Makes sense, let's then create another formula for that? I'll merge this in and release, thank you very much!

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@blimmer I will hold merging and release until ember-cli gets released, @rwjblue @stefanpenner can we sync on that, ping me before release so I'll release this new command too.

@knownasilya

Copy link
Copy Markdown
Collaborator

Sounds like we need a min version option for commands, making the command not run if the version of Ember CLI is less then that min and giving the user a nice message.

@blimmer

blimmer commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

The gist I link to if the file isn't present explains how to get this functionality before the new Ember-CLI version is released. This is pretty crucial to another fix for ember-cli-mirage, and some might want to manually place the destroy-app.js helper before Ember CLI 1.13.9.

However, if the standard is to not release new ember watson before the other PR is mainlined, we can definitely stick to that behavior.

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@blimmer you are right, we don't need to hold this until ember-cli release. :shipit:

abuiles added a commit that referenced this pull request Sep 21, 2015
Migrate acceptance tests to use destroy-app helper
@abuiles
abuiles merged commit 394cfef into abuiles:master Sep 21, 2015
@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@blimmer released 0.6.6 👍 thanks!

@rwjblue

rwjblue commented Sep 21, 2015

Copy link
Copy Markdown
Contributor

Changing that would also mean that we would have to parse the rest of the file to ensure we change any other references to this.application to application to ensure we don't break people's tests.

Agreed, but this migration isn't helpful at all (and might actually result in errors when running tests) if this.application is not set, right?

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@rwjblue

rwjblue commented Sep 21, 2015

Copy link
Copy Markdown
Contributor

@abuiles - I don't think so. Once folks update ember-cli they will have that file (so that guard will not return early), but their tests will not be using this.application.

I did try to review the transform code again, and I think my concerns are unfounded since the transform will use whatever the right hand assignment is of startApp() call (which means app = startApp(), this.foo = startApp(), etc should work fine).

@abuiles

abuiles commented Sep 21, 2015

Copy link
Copy Markdown
Owner

@rwjblue awesome! @blimmer can you confirm?

@blimmer

blimmer commented Sep 21, 2015

Copy link
Copy Markdown
Contributor Author

Yes, the transform will work no matter what you use to store the application object. I explicitly test for it for mocha and qunit. here's the relevant code.

@blimmer
blimmer deleted the destroy-app-helper branch April 25, 2019 22:28
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.

4 participants