Bugfix Interceptor.filteringPath#1543
Conversation
Calling `filteringPath` on the intercept instance was broken as the transform fn set on the scope had the wrong name. Proxying to the Scope’s method allows for the regex version to work too. The bulk of the changed lines come from moving the tests to their appropriate file since the real logic acts on the Scope. Found when looking at Uncovered lines in coveralls.
6188824 to
ee775b8
Compare
paulmelnikow
left a comment
There was a problem hiding this comment.
Thanks so much for breaking this out!
|
|
||
| const { statusCode } = await got('http://example.test/', { | ||
| query: { a: '1', b: '2' }, | ||
| }) |
There was a problem hiding this comment.
These are fine for now (and I know you didn't write them, so this is just a thought for the future!
It's hard to tell from these tests what exactly the feature is for. They don't have descriptive titles, and as far as I can tell they are all positive tests – there's nothing that checks what happens when the request doesn't match the filter.
There was a problem hiding this comment.
I had the same thought, but didn't want to blow up the scope of this PR.
| const scope = nock('http://example.test') | ||
| .filteringPath(path => '/?a=2&b=1') | ||
| .get('/?a=2&b=1') | ||
| .filteringPath(() => '/?a=2&b=1') |
There was a problem hiding this comment.
Just to make sure I'm understanding: this test is of .filteringPath() called on an Interceptor. There's an identical "filter path with function" test of when .filteringPath() is called on a scope, that's being copied to test_scope. Is that right?
Co-Authored-By: mastermatt <matt@mattw.co>
|
Awesome, thank you! 🙌 |
|
🎉 This PR is included in version 11.0.0-beta.12 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Calling `filteringPath` on the intercept instance was broken as the transform fn set on the scope had the wrong name. Proxying to the Scope’s method allows for the regex version to work too. The bulk of the changed lines come from moving the tests to their appropriate file since the real logic acts on the Scope. Found when looking at Uncovered lines in coveralls.
Calling `filteringPath` on the intercept instance was broken as the transform fn set on the scope had the wrong name. Proxying to the Scope’s method allows for the regex version to work too. The bulk of the changed lines come from moving the tests to their appropriate file since the real logic acts on the Scope. Found when looking at Uncovered lines in coveralls.
Calling `filteringPath` on the intercept instance was broken as the transform fn set on the scope had the wrong name. Proxying to the Scope’s method allows for the regex version to work too. The bulk of the changed lines come from moving the tests to their appropriate file since the real logic acts on the Scope. Found when looking at Uncovered lines in coveralls.
Calling `filteringPath` on the intercept instance was broken as the transform fn set on the scope had the wrong name. Proxying to the Scope’s method allows for the regex version to work too. The bulk of the changed lines come from moving the tests to their appropriate file since the real logic acts on the Scope. Found when looking at Uncovered lines in coveralls.
Calling
filteringPathon the intercept instance was broken as thetransform fn set on the scope had the wrong name.
Proxying to the Scope’s method allows for the regex version to work too.
The bulk of the changed lines come from moving the tests to their
appropriate file since the real logic acts on the Scope.
Found when looking at uncovered lines in Coveralls.
Side work, pulled out from #1520.