Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescribableFeature ¶
type DescribableStep ¶
type EnvFunc ¶
EnvFunc represents a user-defined operation that can be used to customize the behavior of the environment. Changes to context are expected to surface to caller.
type Environment ¶
type Environment interface { // WithContext returns a new Environment with a new context WithContext(context.Context) Environment // Setup registers environment operations that are executed once // prior to the environment being ready and prior to any test. Setup(...EnvFunc) Environment // BeforeEachTest registers environment funcs that are executed // before each Env.Test(...) BeforeEachTest(...TestEnvFunc) Environment // BeforeEachFeature registers step functions that are executed // before each Feature is tested during env.Test call. BeforeEachFeature(...FeatureEnvFunc) Environment // AfterEachFeature registers step functions that are executed // after each feature is tested during an env.Test call. AfterEachFeature(...FeatureEnvFunc) Environment // Test executes a test feature defined in a TestXXX function // This method surfaces context for further updates. Test(*testing.T, ...Feature) context.Context // TestInParallel executes a series of test features defined in a // TestXXX function in parallel. This works the same way Test method // does with the caveat that the features will all be run in parallel TestInParallel(*testing.T, ...Feature) context.Context // AfterEachTest registers environment funcs that are executed // after each Env.Test(...). AfterEachTest(...TestEnvFunc) Environment // Finish registers funcs that are executed at the end of the // test suite. Finish(...EnvFunc) Environment // Run Launches the test suite from within a TestMain Run(*testing.M) int // EnvConf returns the test environment's environment configuration EnvConf() *envconf.Config }
Environment represents an environment where features can be tested.
type FeatureEnvFunc ¶
type FeatureEnvFunc func(context.Context, *envconf.Config, *testing.T, Feature) (context.Context, error)
FeatureEnvFunc represents a user-defined operation that can be used to customize the behavior of the environment. Changes to context are expected to surface to caller. Meant for use with before/after feature hooks. *testing.T is provided in order to provide pass/fail context to features.
type TestEnvFunc ¶
TestEnvFunc represents a user-defined operation that can be used to customize the behavior of the environment. Changes to context are expected to surface to caller. Meant for use with before/after test hooks.