{"modulePath":"github.com/hellobyte-dev/tester-utils","version":"v1.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\n## Functions\n\n```go\nfunc CompareOutputWithFixture(t *testing.T, testerOutput []byte, normalizeOutputFunc func([]byte) []byte, fixturePath string)\n```\n\n```go\nfunc IsRecordingOrEvaluatingFixtures() bool\n```\nIsRecordingOrEvaluatingFixtures can be used to run code required to control any external sources of randomness that can affect fixtures.\n\nUse this sparingly, we don't want to introduce too much drift between our test environment and production.\n\nNote: This is only needed to control \\*external\\* sources of randomness. Any random values generated by the tester should use tester\\_utils.random, which uses a fixed seed across all test runs.\n\n```go\nfunc TestTesterOutput(t *testing.T, testerDefinition tester_definition.TesterDefinition, testCases map[string]TesterOutputTestCase)\n```\n\n```go\nfunc ValidateTesterDefinitionAgainstYAML(t testing.T, testerDefinition tester_definition.TesterDefinition, yamlPath string)\n```\nValidateTesterDefinitionAgainstYAML tests whether the stage slugs in TesterDefintion match those in the course YAML at yamlPath.\n\n## Types\n\n```go\ntype TesterOutputTestCase struct {\n\t// CodePath is the path to the code that'll be tested.\n\tCodePath string\n\n\t// ExpectedExitCode is the exit code that we expect the tester to return.\n\tExpectedExitCode int\n\n\t// UntilStageSlug is the slug of the stage that we want to test until. Either this or StageSlug must be provided.\n\tUntilStageSlug string\n\n\t// SkipAntiCheat is a flag that indicates whether we want to skip the anti-cheat check.\n\tSkipAntiCheat *bool\n\n\t// StageSlugs is the list of stages that we want to test. Either this or UntilStageSlug must be provided.\n\tStageSlugs []string\n\n\t// StdoutFixturePath is the path to the fixture file that contains the expected stdout output.\n\tStdoutFixturePath string\n\n\t// NormalizeOutputFunc is a function that normalizes the tester's output. This is useful for removing things like timestamps.\n\tNormalizeOutputFunc func([]byte) []byte\n}\n```\n\n","path":"github.com/hellobyte-dev/tester-utils/testing","name":"testing","synopsis":"","isRedistributable":true}
