franela / goblin

Minimal and Beautiful Go testing framework
MIT License
885 stars 79 forks source link

Error output from testify doesn't use goblin theme #101

Open shasaur opened 3 years ago

shasaur commented 3 years ago

When using the testify framework, I would expect to see the output match the style in the readme (mocha-like) but instead there it kinda looks verbose, uncoloured, and doesn't register as an error in Goblin. Like this:

image

I was wondering if this is by design / not implemented / I am doing something very wrong.

Here is the code for reference:

func TestItem(t *testing.T) {
    g := Goblin(t)

    g.Describe("Item CRUD", func() {
        g.Describe("Should read", func() {
            g.It("An item by name ", func() {
                assert.Equal(t, "expected", "actual")
            })
        })
    })
}
shasaur commented 2 years ago

3 months later I figured it out lmao. You just need to substitute the Golang test framework with the Goblin framework. Knowing this would have saved me some time and made me use this framework more often a longer time ago. So I opened an MR to document this so others don't make the same mistake: https://github.com/franela/goblin/pull/107