-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Don't auto-load prettier-plugin-organize-imports in tests #420
Don't auto-load prettier-plugin-organize-imports in tests #420
Conversation
Could you add a test that would fail if we would not set that? |
@Shinigami92 I'd rather not because I don't want to rely on side-effects in other plugins, and I don't have the time to write a plugin just to test for such a simple setting. We should just only load our own plugin in the tests, and this setting does that. |
@lehni But this setting is just set now in the tests, but before you set it, everything was working the same as before (all tests were green as after the change) Beside that, I thought setting I would still love to see a test that is somehow affected by this change, so we can see that it has somehow a real benefit. |
Setting Setting End of story for me. I don't have the time to write a test for it, and it's time ill spent, because such a test isn't needed. |
If that's the case, then that is what we need to test! |
See here:
That's the only situation where the above became an issue. I just created this PR to avoid such future situations but do what you want with it. Writing a test for it, I won't. |
One last thing:
|
Actually, this make sense, we do the same in core prettier/prettier#12322, this is also hard to test unless we relay on behavior of existing plugin. But I don't think this has something to do with #419, like I commentted, check |
@fisker it does, see here: #419 (comment) |
@lehni I now added a test for the |
@Shinigami92 this is the strangest thing… I also cannot reproduce this problem anymore. While debugging this situation 3 days ago, I have done some manual edits in source files from dependencies, mostly to add console logs and such. I also ran prettier directly using the CLI, and passing in various With a fresh instal of the repo, it now seems that this plugin isn't loaded either way. I would still pass this setting for the reason that @fisker has said, but leave it up to you. The tests seems fine otherwise, but a simpler and more abstract markup would also do, e.g.
|
@fisker I understand that you think that |
|
I guess we can close this? |
I noticed this during debugging #419:
The
prettier-plugin-organize-imports
plugin gets auto-loaded in the unit tests, and it has side-effects that effect the parsers. To make sure we really only test this plugin and exclude such side-effects, we should passpluginSearchDirs: false
to theformatOptions
by default.