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
When using jest, it's common practice to name the test files ComponentName.test.js and put them in an __tests__ directory next to the component. Since these tests import the component and the component does not import the tests, destiny naturally tends to flip the directory structure around. This is unfortunate as it makes it look like the test is the "entry point" rather than a supporting file. Another example of the same pattern is storybook stories, that are typically files that end in .story.js and should probably be handled in the same way as jest tests.
Ideas:
We could treat anything that has a "sub extension" i.e. some-file.some-extenstion.js as being a "supporting file" and keep it beneath the component. Not sure how you do the __tests__/__stories__ bit, but maybe it would be sufficient just to exclude it from the graph and then put it next to the file?
We could accept a config for what files should be treated specially.
I think the best option might be to force people to abandon the __tests__/__stories__ folders and just have
When using jest, it's common practice to name the test files
ComponentName.test.js
and put them in an__tests__
directory next to the component. Since these tests import the component and the component does not import the tests, destiny naturally tends to flip the directory structure around. This is unfortunate as it makes it look like the test is the "entry point" rather than a supporting file. Another example of the same pattern is storybook stories, that are typically files that end in.story.js
and should probably be handled in the same way as jest tests.Ideas:
some-file.some-extenstion.js
as being a "supporting file" and keep it beneath the component. Not sure how you do the__tests__
/__stories__
bit, but maybe it would be sufficient just to exclude it from the graph and then put it next to the file?I think the best option might be to force people to abandon the
__tests__
/__stories__
folders and just haveInput:
Output:
but crucially never:
The text was updated successfully, but these errors were encountered: