* Process an API extractor message. Microsoft's API extractor allows developers to * handle messages before API extractor prints them. This allows us to adjust log level * for certain messages, or to fully prevent messages from being printed out. *
(message: ExtractorMessage)
| 157 | * for certain messages, or to fully prevent messages from being printed out. |
| 158 | * */ |
| 159 | async function processExtractorMessage(message: ExtractorMessage) { |
| 160 | // If the golden does not match, we hide the error as API extractor prints |
| 161 | // a warning asking the user to manually copy the new API report. We print |
| 162 | // a custom warning below asking the developer to run the `.accept` Bazel target. |
| 163 | // TODO: Simplify once https://github.com/microsoft/rushstack/issues/2773 is resolved. |
| 164 | if (message.messageId === ConsoleMessageId.ApiReportNotCopied) { |
| 165 | // Mark the message as handled so that API-extractor does not print it. We print |
| 166 | // a message manually after extraction. |
| 167 | message.handled = true; |
| 168 | message.logLevel = ExtractorLogLevel.None; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | export default function (args: Parameters<typeof testApiGolden>) { |
| 173 | return testApiGolden(...args); |