-
-
Notifications
You must be signed in to change notification settings - Fork 10
test: migrate infer-plugins-ext-dir test cases
#34
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ Thumbs.db | |
|
|
||
| /dist | ||
| /node_modules | ||
| /test/__fixtures__/.temp-* | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/__fixtures__/infer-plugins-ext-dir-with-complex-overrides/.prettierrc.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export default { | ||
| overrides: [ | ||
| { | ||
| files: ["dir/*.foo"], | ||
| options: { | ||
| plugins: ["../plugin-extensions/plugin.cjs"] | ||
| } | ||
| }, | ||
| ] | ||
| }; |
1 change: 1 addition & 0 deletions
1
test/__fixtures__/infer-plugins-ext-dir-with-complex-overrides/1.foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1.foo |
1 change: 1 addition & 0 deletions
1
test/__fixtures__/infer-plugins-ext-dir-with-complex-overrides/dir/2.foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2.foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default { | ||
| plugins: ["../plugin-extensions/plugin.cjs"], | ||
| }; |
1 change: 1 addition & 0 deletions
1
test/__fixtures__/infer-plugins-ext-dir-with-config/src/file.foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| contents |
3 changes: 3 additions & 0 deletions
3
test/__fixtures__/infer-plugins-ext-dir-with-default-options/.prettierrc.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default { | ||
| plugins: ["../plugin-default-options/plugin.cjs"] | ||
| }; |
1 change: 1 addition & 0 deletions
1
test/__fixtures__/infer-plugins-ext-dir-with-default-options/src/file.foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| contents |
3 changes: 3 additions & 0 deletions
3
test/__fixtures__/infer-plugins-ext-dir-with-default-options/src/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| function main() { | ||
| console.log("Hello, World!"); | ||
| } |
12 changes: 12 additions & 0 deletions
12
test/__fixtures__/infer-plugins-ext-dir-with-overrides-and-default-options/.prettierrc.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| export default { | ||
| overrides: [ | ||
| { | ||
| // TODO (43081j): in prettier, this was `*.foo` and would successfully | ||
| // match `src/*.foo`. In prettier CLI, this is not the case | ||
| files: ["**/*.foo"], | ||
| options: { | ||
| plugins: ["../plugin-default-options/plugin.cjs"] | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
1 change: 1 addition & 0 deletions
1
test/__fixtures__/infer-plugins-ext-dir-with-overrides-and-default-options/src/file.foo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| contents |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabiospampinato this one seems like something we should discuss/decide before we merge these tests
it seems prettier treats
*.fooas if it was**/*.foo, whereas we treat it as./*.fooi think we're correct, but this means a whole bunch of prettier configs may fail with our CLI. maybe we should do a special case that transforms
"*.ext"into"**/*.ext"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think so, no need to break the world here. The problem is that this is a bit tricky, what is the actual logic that we want? Worth checking what v3 is actually doing, because there are many potential ways to implement something like this.
I imagine we should try to explode the glob and do something with that in some cases 🤔
I think we can skip this test for now and fix it later if it's the only blocker for this test suite.
Is everything else basically just copy/pasted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much, just the paths changed to the mock/fixture extensions. The rest should be the same