fix(core): make sure requests made outside z.request
are logged
#387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes PDE-2542.
The actual fix itself is a one-liner (marked). The rest of this PR is actually running the tests; this went unnoticed for a long time because we had been skipping these tests.
The opt-out test is a special case because if any other test creates a lambda handler (and many do), then that one test fails. We have to give it its own test run for it to hope to pass.
But, we also need to verify that the test actually ran. When I was first writing the mocha command, it was saying
0 tests ran
👍, which we don't want. So, we have to plug into mocha and make an assertion about the number of tests that ran (1) and the number that passed (1). So, we wrap the whole thing in a bashtest
call and usejq
and mocha's JSON test reporter to get the number of passes (which should be exactly 1). Is this overkill? Maybe, but this is the exact sort of regression that unit tests should catch, and ours didn't.