-
Notifications
You must be signed in to change notification settings - Fork 876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pino-discord-webhook transport information #1922
Conversation
Can you please add a few tests? |
I added information about how to create a webhook and get the URL. I have tried adding testing, but I have no experience with test suites in JS. I looked at the Slack one, but my setup is a bit different. The main issue is I am not sure how to test the actual sending as that is wrapped in the callback function. So I can test that the transport is created, but nothing beyond that. If someone gives me hints I will add it. I will alos ask elsewere. I noticed that there are transports without tests, is this required for publising? |
I double checked and only the logtail one does not have tests. This is unfortunate and it slipped. Overally, yes, I consider tests to be a requirement for inclusion in this list. To test this I would spin up an http server and pass its URL as the webhook. Then, verify this endpoint is called with the expected output. |
Well, I added a test. The idea of a webserver seemed not impossible since what I am doing is simply calling a class in the discord.js library, which handles the rest of the interaction. So I am testing that that call occurs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR adds a discord webhook transport to the list of known transports.