Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build(deps): bump `@octokit/webhooks-*` packages This fixes all the type errors relating to the webhooks types * test: bind errors in try/catch to any * test: fix SonicBoom return type errors * build(deps): downgrade `@octokit/webhooks-methods` t * Fix some tests There are still some failures, but less is failing now * Fix logging tests * Fix most tests * build(deps): downgrade jest * build: remove `semantic-release` from devDeps This way we can use the latest version without introducing dependencies that could conflict with other versions installed for NodeJs v10 support * build(deps): downgrade `@octokit/auth-app` * test: replace 'abuse' with 'secondary rate' as per change on GitHub API * style: prettier * ci(test): use old test runners that support old node versions * ci(test): last try for mac os --------- Co-authored-by: AaronDewes <aaron.dewes@protonmail.com> Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
- Loading branch information
1 parent
02d81f8
commit 5f0ca04
Showing
17 changed files
with
12,311 additions
and
16,309 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
import SonicBoom from "sonic-boom"; | ||
const { streamSym } = require("pino/lib/symbols"); | ||
import type { Logger } from "pino"; | ||
|
||
export async function captureLogOutput(action: () => any): Promise<string> { | ||
export async function captureLogOutput( | ||
action: () => any, | ||
log: Logger | ||
): Promise<string> { | ||
let outputData = ""; | ||
|
||
const sbWrite = SonicBoom.prototype.write; | ||
SonicBoom.prototype.write = function (data) { | ||
// @ts-expect-error | ||
let stdoutSpy = jest.spyOn(log[streamSym], "write") as jest.SpyInstance; | ||
stdoutSpy.mockImplementation((data) => { | ||
outputData += data; | ||
}; | ||
}); | ||
|
||
try { | ||
await action(); | ||
|
||
return outputData; | ||
} finally { | ||
SonicBoom.prototype.write = sbWrite; | ||
stdoutSpy.mockRestore(); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.