Including tests from stretchr/testify
Hi, Your extension is awesome!! I would like to know if you can add the tests made from stretchr/testify lib?
package models
import (
"testing"
"github.com/cryo-management/api/common"
"github.com/cryo-management/api/db"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
_ "github.com/lib/pq"
)
// Define the suite, and absorb the built-in basic suite
// functionality from testify - including assertion methods.
type SchemaTestSuite struct {
suite.Suite
}
// Make sure that VariableThatShouldStartAtFive is set to five
// before each test
func (suite *SchemaTestSuite) SetupTest() {
_ = db.Connect()
}
// All methods that begin with "Test" are run as tests within a
// suite.
func (suite *SchemaTestSuite) TestLoad() {
s := new(Schema)
s.Load("SC016")
assert.Equal(suite.T(), "SC016", s.Code, "invalid generated query")
}
// In order for 'go test' to run this suite, we need to create
// a normal test function and pass our suite to suite.Run
func TestSchemaTestSuite(t *testing.T) {
suite.Run(t, new(SchemaTestSuite))
}
Show only the TestSchemaTestSuite.
Let me check if it's feasible.
@brunopiaui Thank you for providing a valuable suggestion. I have checked and found it's feasible to support this lib. I will be working on the design to have this support and will update here once the pr is ready for it.
Great!!! You should include a donation link in your project 😁. Thanks!
Any updates on this support? Currently, only the start test function is working,the other methods arent.