-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b0c55b
commit 78f9d37
Showing
8 changed files
with
185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./internal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type {StateChangeEvent} from '../types/state-change-events.d.cts'; | ||
|
||
export type RunEvent = { | ||
type: 'stateChange'; | ||
stateChange: StateChangeEvent; | ||
} | { | ||
type: 'run'; | ||
plan: { | ||
bailWithoutReporting: boolean; | ||
debug: boolean; | ||
failFastEnabled: boolean; | ||
filePathPrefix: string; | ||
files: string[]; | ||
matching: boolean; | ||
previousFailures: number; | ||
runOnlyExclusive: boolean; | ||
firstRun: boolean; | ||
}; | ||
}; | ||
|
||
export type {StateChangeEvent} from '../types/state-change-events.d.cts'; | ||
|
||
export type Run = { | ||
events: AsyncIterableIterator<RunEvent>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// For compatibility with resolution algorithms other than Node16. | ||
|
||
export * from './entrypoints/internal.cjs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
type ErrorSource = { | ||
isDependency: boolean | ||
isWithinProject: boolean | ||
file: string | ||
line: number | ||
} | ||
|
||
type SerializedErrorBase = { | ||
message: string | ||
name: string, | ||
originalError: unknown, | ||
stack: string | ||
} | ||
|
||
type AggregateSerializedError = SerializedErrorBase & { | ||
type: "aggregate" | ||
errors: SerializedError[] | ||
} | ||
|
||
type NativeSerializedError = SerializedErrorBase & { | ||
type: "native" | ||
source: ErrorSource | null | ||
} | ||
|
||
type AVASerializedError = SerializedErrorBase & { | ||
type: "ava" | ||
assertion: string | ||
improperUsage: unknown | null | ||
formattedCause: unknown | null | ||
formattedDetails: unknown | unknown[] | ||
source: ErrorSource | null | ||
} | ||
|
||
type SerializedError = AggregateSerializedError | NativeSerializedError | AVASerializedError | ||
|
||
export type StateChangeEvent = { | ||
type: "starting", | ||
testFile: string | ||
} | { | ||
type: "stats", | ||
stats: { | ||
byFile: Map<string, { | ||
declaredTests: number | ||
failedHooks: number, | ||
failedTests: number, | ||
internalErrors: number | ||
remainingTests: number, | ||
passedKnownFailingTests: number, | ||
passedTests: number, | ||
selectedTests: number, | ||
selectingLines: boolean, | ||
skippedTests: number, | ||
todoTests: number, | ||
uncaughtExceptions: number, | ||
unhandledRejections: number, | ||
}> | ||
declaredTests: number | ||
failedHooks: number, | ||
failedTests: number, | ||
failedWorkers: number, | ||
files: number, | ||
parallelRuns: { | ||
currentIndex: number, | ||
totalRuns: number | ||
} | null | ||
finishedWorkers: number, | ||
internalErrors: number | ||
remainingTests: number, | ||
passedKnownFailingTests: number, | ||
passedTests: number, | ||
selectedTests: number, | ||
sharedWorkerErrors: number, | ||
skippedTests: number, | ||
timedOutTests: number, | ||
timeouts: number, | ||
todoTests: number, | ||
uncaughtExceptions: number, | ||
unhandledRejections: number, | ||
} | ||
} | { | ||
type: "declared-test" | ||
title: string | ||
knownFailing: boolean | ||
todo: boolean | ||
testFile: string | ||
} | { | ||
type: "selected-test" | ||
title: string | ||
knownFailing: boolean | ||
skip: boolean | ||
todo: boolean | ||
testFile: string | ||
} | { | ||
type: "test-register-log-reference" | ||
title: string | ||
logs: string[] | ||
testFile: string | ||
} | { | ||
type: "test-passed", | ||
title: string | ||
duration: number | ||
knownFailing: boolean | ||
logs: string[] | ||
testFile: string | ||
} | { | ||
type: "test-failed", | ||
title: string | ||
err: SerializedError, | ||
duration: number | ||
knownFailing: boolean | ||
logs: string[] | ||
testFile: string | ||
} | { | ||
type: "worker-finished", | ||
forcedExit: boolean, | ||
testFile: string | ||
} | { | ||
type: "worker-failed", | ||
nonZeroExitCode?: boolean, | ||
signal?: string, | ||
err?: SerializedError | ||
} | { | ||
type: "touched-files", | ||
files: { | ||
changedFiles: string[], | ||
temporaryFiles: string[] | ||
} | ||
} | { | ||
type: 'worker-stdout', | ||
chunk: Uint8Array | ||
testFile: string | ||
} | { | ||
type: 'worker-stderr', | ||
chunk: Uint8Array | ||
testFile: string | ||
} | { | ||
type: "timeout", | ||
period: number, | ||
pendingTests: Map<string, Set<string>> | ||
} | ||
| { | ||
type: "end" | ||
} |