Belajar golang unit test

Overview

perintah eksekusi di root folder : go test -v ./...

assertion ambil dari framework lain : go get github.com/stretchr/testify

run benchmark go test -v -bench=. (didalam folder berisi file test)

run benchmark di root go test -v -bench=../...

hanya menjalankan benchmark tanpa fungsi test lain go test -v -run=NamaFunsiLain -bench=BenchmarkHelloWorldSub

You might also like...
How we can run unit tests in parallel mode with failpoint injection taking effect and without injection race

This is a simple demo to show how we can run unit tests in parallel mode with failpoint injection taking effect and without injection race. The basic

Go Unit Testing Clean Arch

Golang Unit Testing Tutorial melakukan unit testing di Golang yang sudah menerapkan clean architecture Menjalankan Service PSQL_HOST=IP Database Serv

Vault mock - Mock of Hashicorp Vault used for unit testing

vault_mock Mock of Hashicorp Vault used for unit testing Notice This is a person

Sql mock driver for golang to test database interactions

Sql driver mock for Golang sqlmock is a mock library implementing sql/driver. Which has one and only purpose - to simulate any sql driver behavior in

A test-friendly replacement for golang's time package

timex timex is a test-friendly replacement for the time package. Usage Just replace your time.Now() by a timex.Now() call, etc. Mocking Use timex.Over

Simple HTTP integration test framework for Golang

go-itest Hassle-free REST API testing for Go. Installation go get github.com/jefflinse/go-itest Usage Create tests for your API endpoints and run the

gRPC Test Utilities for Golang
gRPC Test Utilities for Golang

gRPC Test Utilities for Golang Test gRPC service and client like a pro. Prerequisites Go = 1.16 Install go get github.com/nhatthm/grpcmock Usage Invo

Http test server written in Golang.

Dummy Server Http test server written in Golang. Can get any request method and log headers, body, path and remote address. Useful if you need to know

Entain BE Technical Test with golang
Entain BE Technical Test with golang

Entain BE Technical Test This test has been designed to demonstrate your ability and understanding of technologies commonly used at Entain. Please tre

Owner
Dhany
Fullstack Javascript Developer
Dhany
A simple yet intuitive golang unit test framework.

gotest Intuitive and simple golang testing framework which helps in writing unit tests in a way which improves the readability of the test. Here is an

null 1 Jan 1, 2022
Easier way to unit test terraform

Unit testing terraform (WIP) Disclaimer Currently, the only way to compare values is using JSON query path and all types are strings. want := terraf

Thiago Nache Carvalho 51 Aug 16, 2022
Benchmarking deferent Fibonacci functions and algorithms with running unit test

GoFibonacciBench Benchmarking deferent Fibonacci functions and algorithms with running unit test ... Introduction: Fibonacci numbers are special kinds

null 2 Feb 27, 2022
Test-assignment - Test assignment with golang

test-assignment We have a two steam of data and we need to save it in the map: I

null 0 Jan 19, 2022
go-test-trace is like go test but it also generates distributed traces.

go-test-trace go-test-trace is like go test but it also generates distributed traces. Generated traces are exported in OTLP to a OpenTelemetry collect

JBD 376 Jan 5, 2023
Flugel Test Documentation for steps to run and test the automatio

Flugel Test Documentation Documentation for steps to run and test the automation #Test-01 1 - Local Test Using Terratest (End To End) 1- By runing " t

Suc0_Unix 0 Nov 13, 2022
go websocket client for unit testing of a websocket handler

wstest A websocket client for unit-testing a websocket server The gorilla organization provides full featured websocket implementation that the standa

Eyal Posener 98 Dec 21, 2022
gostub is a library to make stubbing in unit tests easy

gostub gostub is a library to make stubbing in unit tests easy. Getting started Import the following package: github.com/prashantv/gostub Click here t

Prashant Varanasi 265 Dec 28, 2022
gomonkey is a library to make monkey patching in unit tests easy

gomonkey is a library to make monkey patching in unit tests easy, and the core idea of monkey patching comes from Bouke, you can read this blogpost for an explanation on how it works.

Zhang Xiaolong 1.4k Jan 4, 2023
A mock of Go's net package for unit/integration testing

netmock: Simulate Go network connections netmock is a Go package for simulating net connections, including delays and disconnects. This is work in pro

Lucas Wolf 1 Oct 27, 2021