Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

jasmine-spec-reporter

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-spec-reporter - npm Package Compare versions

Comparing version 5.0.2 to 7.0.0

built/theme.d.ts

3

built/configuration-parser.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = void 0;
var configuration_1 = require("./configuration");

@@ -75,3 +76,3 @@ function parse(conf) {

if (key === "displayStacktrace" && typeof override[key] === "boolean") {
console.warn("WARN: jasmine-spec-reporter 'displayStacktrace' option supports value ('none', 'raw', 'pretty'), default to 'none'\n".yellow);
console.warn("WARN: jasmine-spec-reporter 'displayStacktrace' option supports value ('none', 'raw', 'pretty'), default to 'none'\n");
result[key] = configuration_1.StacktraceOption.NONE;

@@ -78,0 +79,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Configuration = exports.StacktraceOption = void 0;
var StacktraceOption;

@@ -4,0 +5,0 @@ (function (StacktraceOption) {

/// <reference types="jasmine" />
import { Configuration } from "./configuration";
import { CustomReporterResult } from "./spec-reporter";
import { Theme } from "./theme";
import SuiteInfo = jasmine.SuiteInfo;
export declare class DisplayProcessor {
protected configuration: Configuration;
constructor(configuration: Configuration);
protected theme: Theme;
constructor(configuration: Configuration, theme: Theme);
displayJasmineStarted(info: SuiteInfo, log: string): string;

@@ -9,0 +11,0 @@ displaySuite(suite: CustomReporterResult, log: string): string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DisplayProcessor = void 0;
var DisplayProcessor = /** @class */ (function () {
function DisplayProcessor(configuration) {
function DisplayProcessor(configuration, theme) {
this.configuration = configuration;
this.theme = theme;
}

@@ -7,0 +9,0 @@ DisplayProcessor.prototype.displayJasmineStarted = function (info, log) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var colors = require("colors");
exports.init = void 0;
// tslint:disable-next-line:no-submodule-imports
var colors = require("colors/safe");
function init(configuration) {

@@ -5,0 +7,0 @@ colors.enabled = configuration.colors.enabled;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ColorsDisplay = require("./colors-display");
exports.ExecutionDisplay = void 0;
var ExecutionDisplay = /** @class */ (function () {

@@ -11,3 +11,2 @@ function ExecutionDisplay(configuration, logger, specs, displayProcessors) {

this.suiteHierarchyDisplayed = [];
ColorsDisplay.init(this.configuration);
this.hasCustomDisplaySpecStarted = ExecutionDisplay.hasCustomDisplaySpecStarted(displayProcessors);

@@ -19,3 +18,3 @@ }

var log = "foo";
var result = processor.displaySpecStarted({ id: "bar", description: "bar", fullName: "bar" }, log);
var result = processor.displaySpecStarted({ id: "bar", description: "bar", fullName: "bar", duration: null, properties: null }, log);
isDisplayed = isDisplayed || result !== log;

@@ -99,2 +98,4 @@ });

id: name,
properties: null,
duration: null
};

@@ -101,0 +102,0 @@ this.suiteHierarchy.push(topLevelSuite);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logger = void 0;
var Logger = /** @class */ (function () {

@@ -4,0 +5,0 @@ function Logger(displayProcessors, print) {

import { Configuration } from "../configuration";
import { ExecutionMetrics } from "../execution-metrics";
import { ExecutedSpecs } from "../spec-reporter";
import { Theme } from "../theme";
import { Logger } from "./logger";
export declare class SummaryDisplay {
private configuration;
private theme;
private logger;
private configuration;
private specs;
constructor(logger: Logger, configuration: Configuration, specs: ExecutedSpecs);
constructor(configuration: Configuration, theme: Theme, logger: Logger, specs: ExecutedSpecs);
display(metrics: ExecutionMetrics): void;

@@ -11,0 +13,0 @@ private successesSummary;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SummaryDisplay = void 0;
var SummaryDisplay = /** @class */ (function () {
function SummaryDisplay(logger, configuration, specs) {
function SummaryDisplay(configuration, theme, logger, specs) {
this.configuration = configuration;
this.theme = theme;
this.logger = logger;
this.configuration = configuration;
this.specs = specs;

@@ -15,3 +17,3 @@ }

status = (metrics.totalSpecsDefined === metrics.executedSpecs) ?
" SUCCESS".successful : " INCOMPLETE".pending;
this.theme.successful(" SUCCESS") : this.theme.pending(" INCOMPLETE");
}

@@ -38,4 +40,4 @@ var failed = (metrics.failedSpecs > 0) ? " (" + metrics.failedSpecs + " FAILED)" : "";

}
this.logger.log(execution + status + errors.failed + failed.failed
+ pending.pending + skipped.pending + duration + ".");
this.logger.log(execution + status + this.theme.failed(errors) + this.theme.failed(failed)
+ this.theme.pending(pending) + this.theme.pending(skipped) + duration + ".");
if (metrics.random) {

@@ -98,3 +100,3 @@ this.logger.log("Randomized with seed " + metrics.seed + ".");

var pendingReason = spec.pendingReason ? spec.pendingReason : "No reason given";
this.logger.log(pendingReason.pending);
this.logger.log(this.theme.pending(pendingReason));
this.logger.resetIndent();

@@ -101,0 +103,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecutionMetrics = void 0;
var ExecutionMetrics = /** @class */ (function () {

@@ -34,3 +35,5 @@ function ExecutionMetrics() {

ExecutionMetrics.prototype.stopSpec = function (result) {
result.duration = this.formatDuration((new Date()).getTime() - this.specStartTime);
result._jsr = {
formattedDuration: this.formatDuration((new Date()).getTime() - this.specStartTime)
};
};

@@ -37,0 +40,0 @@ ExecutionMetrics.prototype.formatDuration = function (durationInMs) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StacktraceOption = exports.DisplayProcessor = exports.SpecReporter = void 0;
var spec_reporter_1 = require("./spec-reporter");
exports.SpecReporter = spec_reporter_1.SpecReporter;
Object.defineProperty(exports, "SpecReporter", { enumerable: true, get: function () { return spec_reporter_1.SpecReporter; } });
var display_processor_1 = require("./display-processor");
exports.DisplayProcessor = display_processor_1.DisplayProcessor;
Object.defineProperty(exports, "DisplayProcessor", { enumerable: true, get: function () { return display_processor_1.DisplayProcessor; } });
var configuration_1 = require("./configuration");
exports.StacktraceOption = configuration_1.StacktraceOption;
Object.defineProperty(exports, "StacktraceOption", { enumerable: true, get: function () { return configuration_1.StacktraceOption; } });
//# sourceMappingURL=main.js.map

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultProcessor = void 0;
var configuration_1 = require("../configuration");

@@ -53,3 +56,3 @@ var display_processor_1 = require("../display-processor");

var failedExpectation = _a[_i];
logs.push("- ".failed + failedExpectation.message.failed);
logs.push(this.theme.failed("- ") + this.theme.failed(failedExpectation.message));
if (stacktraceOption === configuration_1.StacktraceOption.RAW && failedExpectation.stack) {

@@ -56,0 +59,0 @@ logs.push(this.configuration.stacktrace.filter(failedExpectation.stack));

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.PrettyStacktraceProcessor = void 0;
var fs = require("fs");

@@ -38,3 +41,3 @@ var configuration_1 = require("../configuration");

var failedExpectation = _a[_i];
logs.push("- ".failed + failedExpectation.message.failed);
logs.push(this.theme.failed("- ") + this.theme.failed(failedExpectation.message));
if (failedExpectation.stack) {

@@ -55,3 +58,3 @@ logs.push(this.prettifyStack(failedExpectation.stack));

var errorContext = _this.retrieveErrorContext(filename, parseInt(lineNumber, 10), parseInt(columnNumber, 10));
logs.push(filename.prettyStacktraceFilename + ":" + lineNumber.prettyStacktraceLineNumber + ":" + columnNumber.prettyStacktraceColumnNumber);
logs.push(_this.theme.prettyStacktraceFilename(filename) + ":" + _this.theme.prettyStacktraceLineNumber(lineNumber) + ":" + _this.theme.prettyStacktraceColumnNumber(columnNumber));
logs.push(errorContext + "\n");

@@ -78,3 +81,3 @@ }

if (i === errorLine) {
logs.push(" ".repeat(columnNb - 1) + "~".red);
logs.push(" ".repeat(columnNb - 1) + this.theme.prettyStacktraceError("~"));
}

@@ -81,0 +84,0 @@ }

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecColorsProcessor = void 0;
var display_processor_1 = require("../display-processor");

@@ -25,9 +28,9 @@ var SpecColorsProcessor = /** @class */ (function (_super) {

SpecColorsProcessor.prototype.displaySuccessfulSpec = function (spec, log) {
return log.successful;
return this.theme.successful(log);
};
SpecColorsProcessor.prototype.displayFailedSpec = function (spec, log) {
return log.failed;
return this.theme.failed(log);
};
SpecColorsProcessor.prototype.displayPendingSpec = function (spec, log) {
return log.pending;
return this.theme.pending(log);
};

@@ -34,0 +37,0 @@ return SpecColorsProcessor;

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecDurationsProcessor = void 0;
var display_processor_1 = require("../display-processor");

@@ -25,3 +28,3 @@ var SpecDurationsProcessor = /** @class */ (function (_super) {

SpecDurationsProcessor.displayDuration = function (spec, log) {
return log + " (" + spec.duration + ")";
return log + " (" + (spec._jsr && spec._jsr.formattedDuration) + ")";
};

@@ -28,0 +31,0 @@ SpecDurationsProcessor.prototype.displaySuccessfulSpec = function (spec, log) {

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecPrefixesProcessor = void 0;
var display_processor_1 = require("../display-processor");

@@ -19,0 +22,0 @@ var SpecPrefixesProcessor = /** @class */ (function (_super) {

@@ -6,6 +6,8 @@ "use strict";

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -17,2 +19,3 @@ function __() { this.constructor = d; }

Object.defineProperty(exports, "__esModule", { value: true });
exports.SuiteNumberingProcessor = void 0;
var display_processor_1 = require("../display-processor");

@@ -19,0 +22,0 @@ var SuiteNumberingProcessor = /** @class */ (function (_super) {

@@ -7,3 +7,5 @@ /// <reference types="jasmine" />

export interface CustomReporterResult extends jasmine.CustomReporterResult {
duration?: string;
_jsr?: {
formattedDuration?: string;
};
}

@@ -23,2 +25,3 @@ export interface ExecutedSpecs {

private configuration;
private theme;
constructor(configuration?: Configuration);

@@ -25,0 +28,0 @@ jasmineStarted(suiteInfo: SuiteInfo): void;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SpecReporter = void 0;
var ConfigurationParser = require("./configuration-parser");

@@ -14,2 +15,3 @@ var execution_display_1 = require("./display/execution-display");

var suite_numbering_processor_1 = require("./processors/suite-numbering-processor");
var theme_1 = require("./theme");
var SpecReporter = /** @class */ (function () {

@@ -23,25 +25,26 @@ function SpecReporter(configuration) {

this.configuration = ConfigurationParser.parse(configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration);
this.theme = new theme_1.Theme(this.configuration);
var displayProcessors = SpecReporter.initProcessors(this.configuration, this.theme);
var print = this.configuration.print;
this.logger = new logger_1.Logger(displayProcessors, print);
this.display = new execution_display_1.ExecutionDisplay(this.configuration, this.logger, this.specs, displayProcessors);
this.summary = new summary_display_1.SummaryDisplay(this.logger, this.configuration, this.specs);
this.summary = new summary_display_1.SummaryDisplay(this.configuration, this.theme, this.logger, this.specs);
this.metrics = new execution_metrics_1.ExecutionMetrics();
}
SpecReporter.initProcessors = function (configuration) {
SpecReporter.initProcessors = function (configuration, theme) {
var displayProcessors = [
new default_processor_1.DefaultProcessor(configuration),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration),
new spec_colors_processor_1.SpecColorsProcessor(configuration),
new pretty_stacktrace_processor_1.PrettyStacktraceProcessor(configuration)
new default_processor_1.DefaultProcessor(configuration, theme),
new spec_prefixes_processor_1.SpecPrefixesProcessor(configuration, theme),
new spec_colors_processor_1.SpecColorsProcessor(configuration, theme),
new pretty_stacktrace_processor_1.PrettyStacktraceProcessor(configuration, theme)
];
if (configuration.spec.displayDuration) {
displayProcessors.push(new spec_durations_processor_1.SpecDurationsProcessor(configuration));
displayProcessors.push(new spec_durations_processor_1.SpecDurationsProcessor(configuration, theme));
}
if (configuration.suite.displayNumber) {
displayProcessors.push(new suite_numbering_processor_1.SuiteNumberingProcessor(configuration));
displayProcessors.push(new suite_numbering_processor_1.SuiteNumberingProcessor(configuration, theme));
}
if (configuration.customProcessors) {
configuration.customProcessors.forEach(function (Processor) {
displayProcessors.push(new Processor(configuration));
displayProcessors.push(new Processor(configuration, theme));
});

@@ -107,2 +110,4 @@ }

id: "Non-spec failure",
duration: null,
properties: null
};

@@ -109,0 +114,0 @@ };

@@ -0,1 +1,61 @@

# 7.0.0
## Bugfix
* 'SpecReporter' is not assignable to type 'Reporter | CustomReporter' [#588](https://github.com/bcaudan/jasmine-spec-reporter/pull/588)
## Breaking change
Update signature of `CustomReporterResult` to fix collision with new jasmine properties
**Before:**
```ts
export interface CustomReporterResult extends jasmine.CustomReporterResult {
duration?: string;
}
```
**Now:**
```ts
export interface CustomReporterResult extends jasmine.CustomReporterResult {
_jsr?: {
formattedDuration?: string;
};
}
```
# 6.0.0
## Feature
* Use colors/safe [#538](https://github.com/bcaudan/jasmine-spec-reporter/pull/538)
## Breaking change
String prototype does not contain color properties anymore, colors must now be applied with the new `theme` component available as a field in [custom display processors](docs/customize-output.md).
**Before:**
```ts
class MyProcessor extends DisplayProcessor {
public displaySuccessfulSpec(spec: CustomReporterResult, log: string): string {
return "OK ".successful + log;
}
}
```
**Now:**
```ts
class MyProcessor extends DisplayProcessor {
public displaySuccessfulSpec(spec: CustomReporterResult, log: string): string {
return this.theme.successful("OK ") + log;
}
}
```
# 5.0.2
## Bugfix
* pretty stacktrace: catch uncaught exception on node internal files [#479](https://github.com/bcaudan/jasmine-spec-reporter/pull/479)
# 5.0.1

@@ -2,0 +62,0 @@

@@ -44,3 +44,3 @@ Output customization

function TimeProcessor(configuration) {
function TimeProcessor(configuration, theme) {
}

@@ -47,0 +47,0 @@

@@ -6,3 +6,3 @@ {

"scripts": {
"postinstall": "webdriver-manager update --gecko false",
"postinstall": "webdriver-manager update --gecko false --versions.chrome=83.0.4103.39",
"test": "protractor protractor.conf.js"

@@ -9,0 +9,0 @@ },

{
"name": "jasmine-spec-reporter",
"version": "5.0.2",
"version": "7.0.0",
"description": "Spec reporter for jasmine behavior-driven development framework",

@@ -50,14 +50,14 @@ "main": "built/main.js",

"devDependencies": {
"@types/jasmine": "3.5.10",
"@types/node": "13.9.4",
"codecov": "3.6.5",
"diff": "4.0.2",
"jasmine": "3.5.0",
"jasmine-core": "3.5.0",
"nyc": "15.0.0",
"protractor": "5.4.3",
"tslint": "6.1.0",
"@types/jasmine": "3.6.9",
"@types/node": "14.14.37",
"codecov": "3.8.1",
"diff": "5.0.0",
"jasmine": "3.7.0",
"jasmine-core": "3.7.1",
"nyc": "15.1.0",
"protractor": "7.0.0",
"tslint": "6.1.3",
"tslint-eslint-rules": "5.4.0",
"typescript": "3.8.2"
"typescript": "4.2.4"
}
}
jasmine-spec-reporter
=====================
[![Greenkeeper badge](https://badges.greenkeeper.io/bcaudan/jasmine-spec-reporter.svg)](https://greenkeeper.io/)
[![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=bcaudan/jasmine-spec-reporter)](https://api.dependabot.com/badges/status?host=github&repo=bcaudan/jasmine-spec-reporter)
[![Build Status](https://travis-ci.org/bcaudan/jasmine-spec-reporter.svg?branch=master)](https://travis-ci.org/bcaudan/jasmine-spec-reporter)

@@ -6,0 +6,0 @@ [![codecov](https://codecov.io/gh/bcaudan/jasmine-spec-reporter/branch/master/graph/badge.svg)](https://codecov.io/gh/bcaudan/jasmine-spec-reporter)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc