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

Anything blocking deploying the new testing API? #205

Closed
ejlangev opened this issue Apr 17, 2018 · 18 comments
Closed

Anything blocking deploying the new testing API? #205

ejlangev opened this issue Apr 17, 2018 · 18 comments

Comments

@ejlangev
Copy link

Was a bit confused because the examples in the docs and the migration guide do not seem to run properly in a new ember app. It appears that there needs to be a new release for the new API which is currently in beta. Is there some place that tracks the status to shipping the new version?

@Turbo87
Copy link
Member

Turbo87 commented Apr 18, 2018

Anything blocking deploying the new testing API?

free time 😞

Was a bit confused because the examples in the docs and the migration guide do not seem to run properly in a new ember app.

they do run properly, but what you see at https://github.com/emberjs/ember-mocha/ is the docs for the master branch. you should look at the docs corresponding to the version that you use, e.g. https://github.com/emberjs/ember-mocha/tree/v0.13.1

Is there some place that tracks the status to shipping the new version?

this issue here, I guess 😉

@ejlangev
Copy link
Author

free time 😞

Well if there's anything I can do to help let me know.

@Turbo87
Copy link
Member

Turbo87 commented Apr 18, 2018

Well if there's anything I can do to help let me know.

there are two things right now that will help accelerate this:

  1. test the beta release and the new testing APIs
  2. add a codemod to https://github.com/Turbo87/ember-mocha-codemods that migrates to the new APIs

the second one is unfortunately a little more involved... 😉

@jgwhite
Copy link

jgwhite commented May 3, 2018

@Turbo87 what’s the recommended way to test the beta release? Is there a complementary release of ember-cli-mocha we can use? Or is it recommended to add ember-mocha as a direct dependency?

@Turbo87
Copy link
Member

Turbo87 commented May 3, 2018

@jgwhite you can remove ember-cli-mocha and instead use ember-mocha directly to test this. at this point ember-cli-mocha is just a legacy wrapper that will eventually go away.

@jgwhite
Copy link

jgwhite commented May 3, 2018

@Turbo87 awesome, thanks for clarifying

@theearthman81
Copy link

I was just checking out the tests on master and noticed it seems to not play well with ember/test-helpers ^0.7.21
It looks to me like because of the shared context in Mocha (https://github.com/mochajs/mocha/wiki/Shared-Behaviours) the extra keys added have to be deleted after each test https://github.com/emberjs/ember-mocha/blob/master/addon-test-support/ember-mocha/setup-test.js#L45

However post 0.7.21 ember test helpers now uses definedProperty which isn't enumerable or configurable by default, so doesn't get deleted. Next time setupTest is called the properties error when being defined as they are not writeable.
(Cannot redefine property: owner)

An "easy" fix looks like adding enumerable and configurable to the descriptor in ember/test-helpers; this might not be desirable though. I am happy to help out if there are any suggestions?

@Turbo87
Copy link
Member

Turbo87 commented May 13, 2018

@jimenglish81 good point, thanks for the analysis. @rwjblue any suggestions? 🤔

@rwjblue
Copy link
Member

rwjblue commented May 14, 2018

An "easy" fix looks like adding enumerable and configurable to the descriptor in ember/test-helpers; this might not be desirable though.

This seems like the right path forward to me...

@theearthman81
Copy link

@rwjblue great thanks for your feedback. I have created a PR...
emberjs/ember-test-helpers#374

@theearthman81
Copy link

add a codemod to https://github.com/Turbo87/ember-mocha-codemods that migrates to the new APIs

@Turbo87 can I help with this at all?

@Turbo87
Copy link
Member

Turbo87 commented May 14, 2018

@jimenglish81 you should talk to @jgwhite. he wanted to look into the codemod situation :)

@jgwhite
Copy link

jgwhite commented May 15, 2018

@Turbo87 @jimenglish81 haha, yes although I must admit I’ve been dragging my heels. 😅

I’ve proposed a little plan of attack to the team at Heroku but we’ve yet to schedule it in.

@jimenglish81 if you want to dive in, don’t let me stop you!

@rwjblue
Copy link
Member

rwjblue commented May 16, 2018

Looks like @rondale-sc picked this up a bit and has a good start going over in ember-codemods/ember-mocha-codemods#17.

@rondale-sc
Copy link

The codemod has been merged into ember-mocha-codemods repo and is in need of some testing. But I think we may be able to start pushing this beta forward now?

@Turbo87
Copy link
Member

Turbo87 commented Jun 3, 2018

@rondale-sc I agree. I will release this as stable next week.

@jgwhite
Copy link

jgwhite commented Jun 3, 2018

Fabulous work, kudos @Turbo87 and @rondale-sc. Can’t wait to migrate our test suite.

@Turbo87
Copy link
Member

Turbo87 commented Jun 5, 2018

released as v0.14.0

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

No branches or pull requests

6 participants