@jest/console
Advanced tools
Comparing version 25.0.0 to 25.1.0
@@ -17,3 +17,3 @@ /** | ||
constructor(getSourceMaps: () => SourceMapRegistry | null | undefined); | ||
static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null, sourceMaps?: SourceMapRegistry | null): import("./types").LogEntry[]; | ||
static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null, sourceMaps?: SourceMapRegistry | null): ConsoleBuffer; | ||
private _log; | ||
@@ -35,4 +35,4 @@ assert(value: any, message?: string | Error): void; | ||
warn(firstArg: any, ...rest: Array<any>): void; | ||
getBuffer(): import("./types").LogEntry[] | undefined; | ||
getBuffer(): ConsoleBuffer | undefined; | ||
} | ||
//# sourceMappingURL=BufferedConsole.d.ts.map |
@@ -18,3 +18,3 @@ /** | ||
private _groupDepth; | ||
constructor(stdout: NodeJS.WritableStream, stderr: NodeJS.WritableStream, formatBuffer?: Formatter); | ||
constructor(stdout: NodeJS.WriteStream, stderr: NodeJS.WriteStream, formatBuffer?: Formatter); | ||
private _log; | ||
@@ -21,0 +21,0 @@ private _logError; |
@@ -48,2 +48,12 @@ 'use strict'; | ||
function _jestUtil() { | ||
const data = require('jest-util'); | ||
_jestUtil = function() { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { | ||
@@ -67,9 +77,2 @@ return obj && obj.__esModule ? obj : {default: obj}; | ||
// TODO: Copied from `jest-util`. Import from it in Jest 25 | ||
function clearLine(stream) { | ||
if (stream.isTTY) { | ||
stream.write('\x1b[999D\x1b[K'); | ||
} | ||
} | ||
class CustomConsole extends _console().Console { | ||
@@ -100,3 +103,3 @@ constructor(stdout, stderr, formatBuffer = (_type, message) => message) { | ||
_log(type, message) { | ||
clearLine(this._stdout); | ||
(0, _jestUtil().clearLine)(this._stdout); | ||
super.log( | ||
@@ -108,3 +111,3 @@ this._formatBuffer(type, ' '.repeat(this._groupDepth) + message) | ||
_logError(type, message) { | ||
clearLine(this._stderr); | ||
(0, _jestUtil().clearLine)(this._stderr); | ||
super.error( | ||
@@ -111,0 +114,0 @@ this._formatBuffer(type, ' '.repeat(this._groupDepth) + message) |
@@ -7,4 +7,5 @@ /** | ||
*/ | ||
declare const _default: (root: string, verbose: boolean, buffer: import("./types").LogEntry[]) => string; | ||
import { ConsoleBuffer } from './types'; | ||
declare const _default: (root: string, verbose: boolean, buffer: ConsoleBuffer) => string; | ||
export default _default; | ||
//# sourceMappingURL=getConsoleOutput.d.ts.map |
@@ -42,25 +42,42 @@ 'use strict'; | ||
function _getRequireWildcardCache() { | ||
if (typeof WeakMap !== 'function') return null; | ||
var cache = new WeakMap(); | ||
_getRequireWildcardCache = function() { | ||
return cache; | ||
}; | ||
return cache; | ||
} | ||
function _interopRequireWildcard(obj) { | ||
if (obj && obj.__esModule) { | ||
return obj; | ||
} else { | ||
var newObj = {}; | ||
if (obj != null) { | ||
for (var key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = | ||
Object.defineProperty && Object.getOwnPropertyDescriptor | ||
? Object.getOwnPropertyDescriptor(obj, key) | ||
: {}; | ||
if (desc.get || desc.set) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
} | ||
if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { | ||
return {default: obj}; | ||
} | ||
var cache = _getRequireWildcardCache(); | ||
if (cache && cache.has(obj)) { | ||
return cache.get(obj); | ||
} | ||
var newObj = {}; | ||
var hasPropertyDescriptor = | ||
Object.defineProperty && Object.getOwnPropertyDescriptor; | ||
for (var key in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, key)) { | ||
var desc = hasPropertyDescriptor | ||
? Object.getOwnPropertyDescriptor(obj, key) | ||
: null; | ||
if (desc && (desc.get || desc.set)) { | ||
Object.defineProperty(newObj, key, desc); | ||
} else { | ||
newObj[key] = obj[key]; | ||
} | ||
} | ||
newObj.default = obj; | ||
return newObj; | ||
} | ||
newObj.default = obj; | ||
if (cache) { | ||
cache.set(obj, newObj); | ||
} | ||
return newObj; | ||
} | ||
@@ -67,0 +84,0 @@ |
@@ -19,3 +19,6 @@ /** | ||
warn(): void; | ||
group(): void; | ||
groupCollapsed(): void; | ||
groupEnd(): void; | ||
} | ||
//# sourceMappingURL=NullConsole.d.ts.map |
@@ -40,4 +40,10 @@ 'use strict'; | ||
warn() {} | ||
group() {} | ||
groupCollapsed() {} | ||
groupEnd() {} | ||
} | ||
exports.default = NullConsole; |
{ | ||
"name": "@jest/console", | ||
"version": "25.0.0", | ||
"version": "25.1.0", | ||
"repository": { | ||
@@ -13,8 +13,9 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/source-map": "^25.0.0", | ||
"chalk": "^2.0.1", | ||
"@jest/source-map": "^25.1.0", | ||
"chalk": "^3.0.0", | ||
"jest-util": "^25.1.0", | ||
"slash": "^3.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 8" | ||
"node": ">= 8.3" | ||
}, | ||
@@ -24,3 +25,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "ff9269be05fd8316e95232198fce3463bf2f270e" | ||
"gitHead": "170eee11d03b0ed5c60077982fdbc3bafd403638" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25310
674
4
1
+ Addedjest-util@^25.1.0
+ Added@jest/types@25.5.0(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Added@types/istanbul-lib-report@3.0.3(transitive)
+ Added@types/istanbul-reports@1.1.2(transitive)
+ Added@types/yargs@15.0.19(transitive)
+ Added@types/yargs-parser@21.0.3(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedci-info@2.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedis-ci@2.0.0(transitive)
+ Addedjest-util@25.5.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@jest/source-map@^25.1.0
Updatedchalk@^3.0.0