mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
30 lines
481 B
Go
30 lines
481 B
Go
package notification
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
|
|
)
|
|
|
|
// this implements the "given" part of given/when/then
|
|
type Context struct {
|
|
t *testing.T
|
|
}
|
|
|
|
func Given(t *testing.T) *Context {
|
|
t.Helper()
|
|
fixture.EnsureCleanState(t)
|
|
return &Context{t: t}
|
|
}
|
|
|
|
func (c *Context) And(block func()) *Context {
|
|
block()
|
|
return c
|
|
}
|
|
|
|
func (c *Context) When() *Actions {
|
|
time.Sleep(fixture.WhenThenSleepInterval)
|
|
return &Actions{context: c}
|
|
}
|