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

Added testing doc and created doc folder #1195

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ADMINS

### For Contributions

Read the contribution doc [here](./Contribution.md)
Read the contribution doc [here](./docs/Contribution.md)

### Stakwork Youtube vidoes download for tribes feed

Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions docs/Testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# Testing on sphinx-tribes

There are two main tests that we run in this project
- Golang/ our backend tests
- Jest unit and component tests/ frontend test

We have git actions for both of these which can be found in `./.github/workflows/prjob_tests.yml`

# Golang/ our backend tests
#### Run the tests
Run this command you may need to install `cover` first run
- `go get golang.org/x/tools/cmd/cover`

To run the tests run
- `go test ./... -tags mock -race -v`
#### Run with coverage
- `go test ./... -tags mock -race -v -coverprofile=coverage.out && ./cover-check.sh coverage.out <min coverage amount>`
#### Other details
- We have a github pr job in `./.github/workflows/prjob_tests.yml` this includes the jest test runner.
- Our tests can be identified in the codebase if you see a file ending in `<filename>_test.go`


## Jest unit and component tests/ frontend tests
In our frontend testing suite we have two types of tests that we run
- Unit tests for files that end in `.ts`
- Component tests for files that end in `.tsx`

You can find configuration in `./frontend/app/jest.config.json`
this includes which files are include and our minimum test coverage amounts.
#### Run test (this is with coverage)
- navigate to `./frontend/app`
- then type `yarn run test`

Loading