Skip to content

Commit 344f8fb

Browse files
add readme
1 parent cd57273 commit 344f8fb

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ e2e-test:
4242
@echo "make e2e-test ${IS_IN_PROGRESS}"
4343
@go clean -testcache
4444
@go test --race -timeout=90s -failfast \
45-
-vet= -cover -covermode=atomic -coverprofile=./.coverage/unit.out \
45+
-vet= -cover -covermode=atomic -coverprofile=./.coverage/e2e.out \
4646
-tags=e2e ./internal/users/delivery/...\
4747

4848
## tests: run tests and any dependencies

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Go Unit Testing Example
2+
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/martinyonatann/go-unit-test)](https://goreportcard.com/report/github.com/martinyonatann/go-unit-test)
4+
[![Go Coverage](https://img.shields.io/badge/coverage-A+-brightgreen.svg)](https://gocov.io/github.com/martinyonatann/go-unit-test)
5+
6+
7+
This repository serves as an example for implementing unit tests in a Golang project. It demonstrates best practices for structuring your codebase to facilitate testing and includes examples of unit tests using the standard `testing` package.
8+
9+
## Getting Started
10+
11+
### Prerequisites
12+
13+
Before running the tests, ensure that you have Golang installed on your machine. You can download it [here](https://golang.org/dl/).
14+
15+
### Running Tests
16+
17+
To run the unit tests, use the following command:
18+
19+
```bash
20+
make tests
21+
```

0 commit comments

Comments
 (0)