This PR fixes Issue #152 however it technically changes the behavior of the library if you were not using the TypeScript definition as it now follows the TypeScript definitions correctly.
Anyone who used the recent "condition mocking" functionality may need to make a change to their code.
If they passed a conditional URL string without a path (i.e. http://foo.com) they must append a trailing slash or it will never match (as the ".url" property of a request always has a path). For regexs, they will match against the URL with the trailing slash.
If they passed a predicate function, that function is now passed a fetch "Request" object instead of the url string (as was previously defined in the TypeScript definitions).
This PR fixes Issue #152 however it technically changes the behavior of the library if you were not using the TypeScript definition as it now follows the TypeScript definitions correctly.
Anyone who used the recent "condition mocking" functionality may need to make a change to their code.
If they passed a conditional URL string without a path (i.e. http://foo.com) they must append a trailing slash or it will never match (as the ".url" property of a request always has a path). For regexs, they will match against the URL with the trailing slash.
If they passed a predicate function, that function is now passed a fetch "Request" object instead of the url string (as was previously defined in the TypeScript definitions).