binygal / jest-runner-flowtype

Jest runner for running flowtype tests using jest as a platform
26 stars 10 forks source link

Use manual string splitting rather than regex to build fileName #9

Closed slightlytyler closed 6 years ago

slightlytyler commented 6 years ago

fixes #8

This might not be the best way to handle it, what do you think?

binygal commented 6 years ago

This was my initial implementation but I had a suggestion to change it. (https://github.com/binygal/jest-runner-flowtype/pull/3#pullrequestreview-105438260) I think that we can just extend the regex to support dot as part of file name (or directory) like that - (\.{1,2}|\/)?([A-z]|\/|-|\.)*\.js(x?) What do you think?

slightlytyler commented 6 years ago

@binygal I'm not familiar with the expected range of inputs but can try changing the RegEx. Figured the manual splitting would not be general enough to actually work 😉

binygal commented 6 years ago

The accepted range is a js/jsx file path, absolute or relative. Right now it accepts only files folders with letters or dash in the path. My suggestion adds the dot, you can take it and digits or whatever character that make sense in file/folder names.

slightlytyler commented 6 years ago

@binygal ok I've updated it to use the pattern you suggested. If you think it's sufficient would love to get this merged 👍

binygal commented 6 years ago

This PR was created against the initial branch 😃I've rebased it against master and pushed the changes. @slightlytyler Thank you for contributing!