Add testing for application (backend, frontend, end2end)#270
Merged
alex-anakin merged 44 commits intohackforla:developmentfrom Aug 28, 2020
Merged
Add testing for application (backend, frontend, end2end)#270alex-anakin merged 44 commits intohackforla:developmentfrom
alex-anakin merged 44 commits intohackforla:developmentfrom
Conversation
Moving the instantiation of the server away from the application itself allows us to import the express app as a moodule and test it. This keeps us from actually spinning up a server instance on every import.
The slack app is starting every time the application is initialized, which is causing the tests to be unable to close. This work will be refactored out here soon.
These test cases showcase being able to write unit test and integration tests using the database, models, and api.
The project was having package management version conflicts when using npm. The suggested solution was to move to yarn, which works.
nickbeaird
commented
Aug 27, 2020
nickbeaird
commented
Aug 27, 2020
alex-anakin
approved these changes
Aug 28, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds in frontend testing for the application. This branch was branched from #264.
Overview:
Our application is in some dire need of some repeatability and testing is just the thing to remedy this. The goal of this branch started with getting our unit tests working again. It then moved into a discussion of what would help the team, which came up as adding something like Cypress. In all, this branch makes things much more repeatable and tested!
Acceptance Criteria:
[x] We have working Jest tests in the frontend
[x] We have working Jest tests in the backend
[x] We have a working end-2-end test suite (likely Cypress)
[x] Make sure that all test runners are working as expected.
[x] Configurable environment variables
[x] Update the README and relevant end documentation.
Setup & Verification Steps:
Move your .env file at the root directory to the backend directory
Add the below variables to your backend/.env file
BACKEND_PORT=YOUR_DESIRED_PORT
REACT_APP_PROXY=http://localhost:${BACKEND_PORT}
SLACK_OAUTH_TOKEN=ASK_NICK_FOR_HIS?
SLACK_BOT_TOKEN=ASK_NICK_FOR_HIS?
SLACK_TEAM_ID=ASK_NICK_FOR_HIS?
SLACK_CHANNEL_ID=ASK_NICK_FOR_HIS?
SLACK_CLIENT_ID=ASK_NICK_FOR_HIS?
SLACK_CLIENT_SECRET=ASK_NICK_FOR_HIS?
SLACK_SIGNING_SECRET=ASK_NICK_FOR_HIS?
Add the below variables to your client/.env file
CLIENT_PORT=YOUR_DESIRED_PORT
CLIENT_URL=http://localhost:${CLIENT_PORT}
Delete all of your package.json file and nod_modules directories
Run yarn install in the root, backend, and client directories.
The above should have a fully functional running sets of test suites