Skip to content
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

Enhancing unit tests using gorilla/mux #58

Open
fear-the-reaper opened this issue Sep 5, 2022 · 0 comments
Open

Enhancing unit tests using gorilla/mux #58

fear-the-reaper opened this issue Sep 5, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@fear-the-reaper
Copy link
Contributor

Since we are using Go's httptest to simulate our IntelOwl server through by creating a mock test server from httptest.Server and using httptest.ServeMux as a router to implement our mock responses on the specified endpoint

Right now we need are initializing the test server with every test. By using gorilla/mux we can implement a request method-based router from which we only need to set up the test server once and keep using that for every test!

To implement a common setup and teardown we can use TestMain. For more information, you can read about it here.

@fear-the-reaper fear-the-reaper added the enhancement New feature or request label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant