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

Use global setup/teardown of test database, add student endpoint tests #143

Merged
merged 12 commits into from
Oct 1, 2024

Conversation

Carifio24
Copy link
Member

This PR makes the next round of progress on setting up our test suite. The main improvement here is to move the database setup and teardown into Jest's globalSetup and globalTeardown. The global setup/teardown completely bookend the execution of any of the test files. Note that we can't export global variables out of these, and that's fine - we can set a client up in each test file. This PR also adds a couple tests of the student endpoints. Note that each of these tests destroys any resources that it creates in the database. I think this is generally a good pattern - the only things that we want to keep around between tests are things like an "API key" for authorization, as that's independent of any particular test logic.

@Carifio24 Carifio24 force-pushed the global-setup-teardown-students branch 3 times, most recently from 9962bd3 to 908ae30 Compare October 1, 2024 18:37
@Carifio24 Carifio24 force-pushed the global-setup-teardown-students branch from 64c95a9 to cdef6ad Compare October 1, 2024 21:16
@Carifio24 Carifio24 merged commit f72a7d1 into cosmicds:main Oct 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant