Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Console to custom console object #10502

Merged
merged 6 commits into from Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/jest-console/src/BufferedConsole.ts
Expand Up @@ -39,6 +39,8 @@ export default class BufferedConsole extends Console {
this._groupDepth = 0;
}

Console: NodeJS.ConsoleConstructor = Console;

static write(
buffer: ConsoleBuffer,
type: LogType,
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-console/src/CustomConsole.ts
Expand Up @@ -37,6 +37,8 @@ export default class CustomConsole extends Console {
this._groupDepth = 0;
}

Console: NodeJS.ConsoleConstructor = Console;

private _log(type: LogType, message: string) {
clearLine(this._stdout);
super.log(
Expand Down
6 changes: 6 additions & 0 deletions packages/jest-console/src/__tests__/CustomConsole.test.ts
Expand Up @@ -224,4 +224,10 @@ describe('CustomConsole', () => {
_console.timeEnd('custom');
});
});

describe('console', () => {
test('should be able to initialize console instance', () => {
expect(_console.Console).toBeDefined();
});
});
});
6 changes: 6 additions & 0 deletions packages/jest-console/src/__tests__/bufferedConsole.test.ts
Expand Up @@ -184,4 +184,10 @@ describe('CustomConsole', () => {
_console.timeEnd('custom');
});
});

describe('console', () => {
test('should be able to initialize console instance', () => {
expect(_console.Console).toBeDefined();
});
});
});