All Projects → otiai10 → mint

otiai10 / mint

Licence: MIT license
The very minimum assertion for Golang testing framework.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mint

assert
Go 语言 assert 断言函数
Stars: ✭ 17 (-34.62%)
Mutual labels:  assertion
probably
To probe what we can't prove, so the unprovable may become probable
Stars: ✭ 58 (+123.08%)
Mutual labels:  assertion
type-guards
Simple utility for runtime type checking which also assigns the correct type if used with TypeScript.
Stars: ✭ 30 (+15.38%)
Mutual labels:  assertion
jest-expect-contain-deep
Assert deeply nested values in Jest
Stars: ✭ 68 (+161.54%)
Mutual labels:  assertion

mint

Go codecov GoDoc FOSSA Status

The very minimum assertion for Go.

package your_test

import (
    "testing"
    "pkg/your"
    . "github.com/otiai10/mint"
)

func TestFoo(t *testing.T) {

    foo := your.Foo()
    Expect(t, foo).ToBe(1234)
    Expect(t, foo).TypeOf("int")
    Expect(t, foo).Not().ToBe(nil)
    Expect(t, func() { yourFunc() }).Exit(1)

    // If assertion failed, exit 1 with message.
    Expect(t, foo).ToBe("foobarbuz")

    // You can run assertions without os.Exit
    res := Expect(t, foo).Dry().ToBe("bar")
    // res.OK() == false

    // You can omit repeated `t`.
    m := mint.Blend(t)
    m.Expect(foo).ToBe(1234)
}

features

  • Simple syntax
  • Loosely coupled
  • Plain implementation

tests

go test ./...

use cases

Projects bellow use mint

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].