Description
Fake is a fake data generator for Go (Golang), heavily inspired by the forgery and ffaker Ruby gems.
Fake alternatives and similar packages
Based on the "Testing" category.
Alternatively, view Fake alternatives based on common mentions on social networks and blogs.
-
Testify
A toolkit with common assertions and mocks that plays nicely with the standard library -
chromedp
A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol. -
GoConvey
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go. -
realize
Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading. -
selenoid
Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary. -
Testcontainers-go
Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done. -
hoverfly
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers -
playwright-go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API. -
gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻 -
go-vcr
Record and replay your HTTP interactions for fast, deterministic and accurate tests -
testfixtures
Ruby on Rails like test fixtures for Go. Write tests against a real database -
counterfeiter
A tool for generating self-contained, type-safe test doubles in go -
cdp
Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language. -
embedded-postgres
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test -
gotest.tools
A collection of packages to augment the go testing package and support common patterns. -
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕 -
go-testdeep
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite
Static code analysis for 29 languages.
Do you think we are missing an alternative of Fake or a related project?
Popular Comparisons
README
Fake
Fake is a fake data generator for Go (Golang), heavily inspired by the forgery and ffaker Ruby gems.
About
Most data and methods are ported from forgery/ffaker Ruby gems. For the list of available methods please look at https://godoc.org/github.com/icrowley/fake. Currently english and russian languages are available.
Fake embeds samples data files unless you call UseExternalData(true)
in order to be able to work without external files dependencies when compiled, so, if you add new data files or make changes to existing ones don't forget to regenerate data.go file using github.com/mjibson/esc
tool and esc -o data.go -pkg fake data
command (or you can just use go generate
command if you are using Go 1.4 or later).
Install
go get github.com/icrowley/fake
Import
import (
"github.com/icrowley/fake"
)
Documentation
Documentation can be found at godoc:
https://godoc.org/github.com/icrowley/fake
Test
To run the project tests:
cd test
go test
Examples
name := fake.FirstName()
fullname := fake.FullName()
product := fake.Product()
Changing language:
err := fake.SetLang("ru")
if err != nil {
panic(err)
}
password := fake.SimplePassword()
Using english fallback:
err := fake.SetLang("ru")
if err != nil {
panic(err)
}
fake.EnFallback(true)
password := fake.Paragraph()
Using external data:
fake.UseExternalData(true)
password := fake.Paragraph()
Author
Dmitry Afanasyev, http://twitter.com/i_crowley [email protected]
Maintainers
Dmitry Moskowski https://github.com/corpix
*Note that all licence references and agreements mentioned in the Fake README section above
are relevant to that project's source code only.