-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathsuite_test.go
40 lines (34 loc) · 1.14 KB
/
suite_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package testutil_test
import (
"github.com/stretchr/testify/suite"
"github.com/synapsecns/sanguine/core/testsuite"
"github.com/synapsecns/sanguine/ethergo/backends"
"github.com/synapsecns/sanguine/ethergo/backends/simulated"
"github.com/synapsecns/sanguine/services/explorer/testutil"
"testing"
)
// SimulatedSuite is used to test individual contract deployments to make sure other tests don't break.
type SimulatedSuite struct {
*testsuite.TestSuite
// testBackend is the test backend
testBackend backends.SimulatedTestBackend
// deployManager is the deploy helper
deployManager *testutil.DeployManager
}
// SetupTest sets up a test.
func (s *SimulatedSuite) SetupTest() {
s.TestSuite.SetupTest()
s.testBackend = simulated.NewSimulatedBackend(s.GetTestContext(), s.T())
s.deployManager = testutil.NewDeployManager(s.T())
s.deployManager.GetContractRegistry(s.testBackend)
}
// NewSimulatedSuite creates a end-to-end test suite.
func NewSimulatedSuite(tb testing.TB) *SimulatedSuite {
tb.Helper()
return &SimulatedSuite{
TestSuite: testsuite.NewTestSuite(tb),
}
}
func TestSimulatedSuite(t *testing.T) {
suite.Run(t, NewSimulatedSuite(t))
}