Formatting
This commit is contained in:
@@ -92,27 +92,36 @@ export const createMockIO = (): MockIO => {
|
||||
* @param spies - The mock IO spies from createMockIO
|
||||
* @param logs - Array of log expectations to validate
|
||||
*/
|
||||
export const expectLogs = (spies: MockIOSpies, logs: LogExpectation[]): void => {
|
||||
export const expectLogs = (
|
||||
spies: MockIOSpies,
|
||||
logs: LogExpectation[],
|
||||
): void => {
|
||||
for (const log of logs) {
|
||||
if (log.out !== undefined) {
|
||||
if (log.exact) {
|
||||
expect(spies.out).toHaveBeenCalledWith(log.out);
|
||||
} else {
|
||||
expect(spies.out).toHaveBeenCalledWith(expect.stringContaining(log.out));
|
||||
expect(spies.out).toHaveBeenCalledWith(
|
||||
expect.stringContaining(log.out),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (log.err !== undefined) {
|
||||
if (log.exact) {
|
||||
expect(spies.err).toHaveBeenCalledWith(log.err);
|
||||
} else {
|
||||
expect(spies.err).toHaveBeenCalledWith(expect.stringContaining(log.err));
|
||||
expect(spies.err).toHaveBeenCalledWith(
|
||||
expect.stringContaining(log.err),
|
||||
);
|
||||
}
|
||||
}
|
||||
if (log.verbose !== undefined) {
|
||||
if (log.exact) {
|
||||
expect(spies.verbose).toHaveBeenCalledWith(log.verbose);
|
||||
} else {
|
||||
expect(spies.verbose).toHaveBeenCalledWith(expect.stringContaining(log.verbose));
|
||||
expect(spies.verbose).toHaveBeenCalledWith(
|
||||
expect.stringContaining(log.verbose),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user