Skip to content

Commit

Permalink
fix(jest-types): remove deprecated types by Node.js 16
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jul 8, 2021
1 parent f3e5564 commit 126c1ae
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.DS_STORE
.eslintcache
*.swp
*.iml
*~
/examples/*/node_modules/
/examples/mongodb/globalConfig.json
Expand Down
6 changes: 3 additions & 3 deletions packages/jest-console/src/BufferedConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import assert = require('assert');
import {Console} from 'console';
import {format, formatWithOptions, inspect} from 'util';
import {format, formatWithOptions, inspect, InspectOptions} from 'util';
import chalk = require('chalk');
import {ErrorWithStack, formatTime} from 'jest-util';
import type {
Expand All @@ -24,7 +24,7 @@ export default class BufferedConsole extends Console {
private _timers: LogTimers = {};
private _groupDepth = 0;

Console: NodeJS.ConsoleConstructor = Console;
Console: typeof Console = Console;

constructor() {
super({
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class BufferedConsole extends Console {
this._log('debug', format(firstArg, ...rest));
}

dir(firstArg: unknown, options: NodeJS.InspectOptions = {}): void {
dir(firstArg: unknown, options: InspectOptions = {}): void {
const representation = inspect(firstArg, options);
this._log('dir', formatWithOptions(options, representation));
}
Expand Down
6 changes: 3 additions & 3 deletions packages/jest-console/src/CustomConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import assert = require('assert');
import {Console} from 'console';
import {format, formatWithOptions, inspect} from 'util';
import {format, formatWithOptions, inspect, InspectOptions} from 'util';
import chalk = require('chalk');
import {clearLine, formatTime} from 'jest-util';
import type {LogCounters, LogMessage, LogTimers, LogType} from './types';
Expand All @@ -22,7 +22,7 @@ export default class CustomConsole extends Console {
private _timers: LogTimers = {};
private _groupDepth = 0;

Console: NodeJS.ConsoleConstructor = Console;
Console: typeof Console = Console;

constructor(
stdout: NodeJS.WriteStream,
Expand Down Expand Up @@ -73,7 +73,7 @@ export default class CustomConsole extends Console {
this._log('debug', format(firstArg, ...args));
}

dir(firstArg: unknown, options: NodeJS.InspectOptions = {}): void {
dir(firstArg: unknown, options: InspectOptions = {}): void {
const representation = inspect(firstArg, options);
this._log('dir', formatWithOptions(options, representation));
}
Expand Down

0 comments on commit 126c1ae

Please sign in to comment.