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

Update mirage logging option to work with qunit5 #2093

Merged
merged 1 commit into from
Dec 21, 2020

Conversation

cah-brian-gantzler
Copy link
Collaborator

Fixes #2091

There were no tests for the original adding of the option, I dont see how to add tests as it not a test of the addon but how the addon works with Qunit.

  • Moved the adding of the option from vendor/add-qunit-option to test-support/qunit-configuration same as qunit5 does
  • Moved import of code from index.js to test-support/index.js. This means if you never import setupMirage you will never see the option added, which kinda makes sense. This also means you wont see it if you run the tests in this repo, since none of the tests import setupMirage

@cah-brian-gantzler
Copy link
Collaborator Author

What next to get this merged in?

Copy link
Collaborator

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

sorry, forgot about it 😱

@Turbo87 Turbo87 merged commit 718f789 into miragejs:master Dec 21, 2020
@Turbo87
Copy link
Collaborator

Turbo87 commented Dec 22, 2020

@cah-briangantzler I just tried this out on an app that is still using ember-qunit v4 and the checkbox is unfortunately not visible anymore. can you check if we can make this work again too?

@cah-brian-gantzler
Copy link
Collaborator Author

I updated my application to use ember-cli-mirage 2.0.0, it is still using ember-qunit ^4.6.0 and the checkbox is visible for me.

I am unable to update my application to qunit v5 as I use ember-cli-page-object and that is NOT ember-qunit 5 compatible at this time.

I did temporarily update (but did not commit) the ember-cli-mirage tests to ember-qunit 5 and the checkbox was visible and working.

@cah-brian-gantzler
Copy link
Collaborator Author

@Turbo87 Were you able to get this to work? There is a nuance I mentioned earlier, previously just including the addon added the check box to the qunit testing, even if you never imported setupMirage (and presumably created a mirage server). Where I moved it to requires you to at least import something (mostly likely setupMirage) from 'ember-cli-mirage'. That was not on purpose, it is a by product of where I moved it, but kinda makes sense, if you never import and create a server, having the checkbox does not really do anything.

Are you creating the mirage server on your own without importing setupMirage?

@Turbo87
Copy link
Collaborator

Turbo87 commented Jan 5, 2021

I think I found the issue. We were importing setupMirage() like this:

import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';

but since the urlConfig change happens in the index.js file it was never triggered. I've now changed our imports to this:

import { setupMirage } from 'ember-cli-mirage/test-support';

and now it works... 😅

@cah-brian-gantzler
Copy link
Collaborator Author

Great to hear

@pomm0
Copy link

pomm0 commented Oct 13, 2021

This seems to not work when using the autostart option. Not sure how common this option is, probably not so common, since its not even documented.

Any chance to make it work via the autostart option or would you recommend using the setupMirage test helper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mirage logging checkbox doesn't render in ember-qunit v5
3 participants