DNS-over-Discord icon indicating copy to clipboard operation
DNS-over-Discord copied to clipboard

Add end-to-end testing for dig command

Open MattIPv4 opened this issue 3 years ago • 0 comments

For now, I'm only worried about testing the dig command. This will lay the ground-work for testing other commands down the road.

Implement end-to-end testing that simulates a valid interaction call from Discord to the worker (likely using wrangler in the dry-run mode and miniflare to run it in a simulated Workers environment), and ensure that the expected response is received. This will also need network calls mocked so that we can ensure the correct follow-up API calls are made to Discord, as the dig command handles responding asynchronously after the request.

To be clear, this is a pretty complex issue that involves setting up all the ground-work for testing in this repo, as well as fully mocking the Discord API calls involved in the interactions flow.

The end goal here is to have a test suite that can call the dig command (with any domain, any types, any options) as if it were a Discord user running a command, and we can validate that the bot will respond as we expect.

MattIPv4 avatar Oct 10 '22 21:10 MattIPv4