-- ROBLOX deviation END


export type ReporterOnStartOptions = { estimatedTime: number, showStatus: boolean }

export type Context = {
	config: Config_ProjectConfig,
	hasteFS: HasteFS,
	moduleMap: ModuleMap,
	resolver: Resolver,
}

export type Test = { context: Context, duration: number?, path: Config_Path }

export type CoverageWorker = { worker: worker }

export type CoverageReporterOptions = {
	changedFiles: Set<Config_Path>?,
	sourcesRelatedToTestsInChangedFiles: Set<Config_Path>?,
}

export type CoverageReporterSerializedOptions = {
	changedFiles: Array<Config_Path>?,
	sourcesRelatedToTestsInChangedFiles: Array<Config_Path>?,
}

export type OnTestStart = (test: Test) -> Promise<void>

export type OnTestFailure = (test: Test, error_: SerializableError) -> Promise<unknown>

export type OnTestSuccess = (test: Test, result: TestResult) -> Promise<unknown>

export type Reporter = {
	onTestResult: ((
		self: Reporter,
		test: Test,
		testResult: TestResult,
		aggregatedResult: AggregatedResult
	) -> Promise<void> | void)?,
	onTestFileResult: ((
		self: Reporter,
		test: Test,
		testResult: TestResult,
		aggregatedResult: AggregatedResult
	) -> Promise<void> | void)?,
	onTestCaseResult: ((self: Reporter, test: Test, testCaseResult: TestCaseResult) -> Promise<void> | void)?,
	onRunStart: (self: Reporter, results: AggregatedResult, options: ReporterOnStartOptions) -> Promise<void> | void,
	onTestStart: ((self: Reporter, test: Test) -> Promise<void> | void)?,
	onTestFileStart: ((self: Reporter, test: Test) -> Promise<void> | void)?,
	onRunComplete: (self: Reporter, contexts: Set<Context>, results: AggregatedResult) -> Promise<void> | void,
	getLastError: (self: Reporter) -> Error | void,
}

export type SummaryOptions = {
	currentTestCases: Array<{ test: Test, testCaseResult: TestCaseResult }>?,
	estimatedTime: number?,
	roundTime: boolean?,
	width: number?,
}

export type TestRunnerOptions = { serial: boolean }

export type TestRunData = Array<{
	context: Context,
	matches: { allTests: number, tests: Array<Test>, total: number },
}>

export type TestSchedulerContext = {
	firstRun: boolean,
	previousSuccess: boolean,
	changedFiles: Set<Config_Path>?,
}

return exports
