You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been able to run ember-cli-fastboot-testing with ember-mocha.
Unfortunately, yarn link breaks the app for me, so I wasn't able to make a PR quickly. Also, I used a weird hack. Hopefully, you'll be able to find a better solution.
When porting the test file to Mocha, I ran into two issues.
ember-mocha requires running a setup helper. It has a few to offer, and every one of them runs setupContext and teardownContext. Since running those twice crashes the test pipeline, ember-cli-fastboot-testing can't be used, so I had to make my own without setupContext and teardownContext.
My tests started passing, but the test pipeline crashed on teardown after all tests. The error was from inside Glimmer, where it was doing something like parent.remove(child) and crashing with "this child does not belong to this parent".
I was able to identify the parent as the testing container. The child turned out to be the application div inside the container, that happens to be there before visit from ember-cli-fastboot-testing is called.
I managed to fix the issue with a weird workaround. In the before hook, I remove the content of the test container and stash it. In the after hook, I put it back! It feels like an ugly hack 🙈, but it did unblock ember-cli-fastboot-testing for me.
So here's my setup helper that enables ember-cli-fastboot-testing to be used with ember-mocha:
Hi!
I've been able to run
ember-cli-fastboot-testing
withember-mocha
.Unfortunately,
yarn link
breaks the app for me, so I wasn't able to make a PR quickly. Also, I used a weird hack. Hopefully, you'll be able to find a better solution.When porting the test file to Mocha, I ran into two issues.
ember-mocha
requires running a setup helper. It has a few to offer, and every one of them runssetupContext
andteardownContext
. Since running those twice crashes the test pipeline,ember-cli-fastboot-testing
can't be used, so I had to make my own withoutsetupContext
andteardownContext
.My tests started passing, but the test pipeline crashed on teardown after all tests. The error was from inside Glimmer, where it was doing something like
parent.remove(child)
and crashing with "this child does not belong to this parent".I was able to identify the parent as the testing container. The child turned out to be the application div inside the container, that happens to be there before
visit
fromember-cli-fastboot-testing
is called.I managed to fix the issue with a weird workaround. In the before hook, I remove the content of the test container and stash it. In the after hook, I put it back! It feels like an ugly hack 🙈, but it did unblock
ember-cli-fastboot-testing
for me.So here's my setup helper that enables
ember-cli-fastboot-testing
to be used withember-mocha
:The text was updated successfully, but these errors were encountered: