unfetch
unfetch copied to clipboard
Regex tests
Need to add regex tests. Tested expression on validators, it gives strange results. @developit could you provide expectations?
What regex tests?
For /^(.*?):\s*([\s\S]*?)$/gm.
What do we expect for input?
I can't get what you're talking about. Where's that? What regexes here?
28 lines.
Good moin'. Next time when open an issue describe what you mean as much as possible in your title and first post.
Wonder that you have not understand. Anyway mention was not for you.
@dimpiax I had a bunch of tests I was running in a REPL when writing the header parsing, I should have ported them to unit tests but didn't. Happy to merge a PR that does it. Easiest way will be to mock out XMLHttpRequest, stub getAllResponseHeaders() to return any variances we can find, and then invoke onload() manually.
@developit considering the changes to the headers regex in #92 I'm not sure of the best way to test this anymore. The headers regex is now extremely simple and we're leveraging the internals of XMLHttpRequest with getResponseHeader(). You'll see in that PR the headers tests are by no means comprehensive. Stubbing getResponseHeader in this case isn't really a very useful test. Do we just rely on the XMLHttpRequest internals and only test our (very simple) regex then?