-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Prevent path prefix from being incorrectly applied #3233
Prevent path prefix from being incorrectly applied #3233
Conversation
Awesome, thanks for looking into this! There's a test file already for loader.js — probably could add a new test there. |
Deploy preview ready! Built with commit 39b0a29 |
@m-allanson want to add a test or two here so we can ship it? |
Yeah I was planning to dig into this again today. I added a couple of tests before, but either my understanding is wrong (quite likely 😀) or there's another issue with path prefixes. So I need to revisit it. |
@KyleAMathews This is updated now, I think it fixes up an extra couple of oddities around the path prefix handling. I've tested various path prefix combinations on a demo Gatsby site, but it'd be good to get confirmation that I've done that properly 😀 |
Urgh the CI fails on Node 6, but passes on Node 8. I'm out of time for now, but can take another look next week if no one picks it up before then. |
Looks like "startsWith" is the problem — added simple polyfill from MDN. |
Actually polyfilling this is silly. Implementing the algorithm. |
Hmm something still failing in node 6. |
Perhaps with how Jest does the global stuff. |
@KyleAMathews I was able to reproduce this in a standalone repo: https://github.com/m-allanson/jest-global-test. I've posted an issue over at facebook/jest in case it's something that can be fixed on their side. |
Now Travis is 💚 on Node 6 and 8. |
Nice! Thanks for persevering through the weirdness :-) |
This fixes #2551 in my example repo, and it doesn't break any existing tests.
Are there any tests I can add to ensure this stays fixed?
Possibly this resolves the following issues too: #2740 and #3104.