Created
November 18, 2024 19:01
-
-
Save nedgrady/54f589fb3ecc8cbb7cfa8f6d7d140dbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expect.extend({ | |
toBeRequest(received: http.ClientRequest, expected: http.ClientRequest) { | |
const pass = received === expected | |
return { | |
pass, | |
message: () => `Expected requests${this.isNot ? "not " : ""} to be equal`, | |
// expected/actual object graphs are displayed under the test failure message | |
expected: { method: expected.method, path: expected.path, requestId: expected.getHeader("x-request-id") }, | |
actual: { method: received.method, path: received.path, requestId: received.getHeader("x-request-id") }, | |
} | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment