New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@japa/base-reporter

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@japa/base-reporter - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0-0

build/src/base_reporter.d.ts.map

4

build/index.d.ts

@@ -1,2 +0,2 @@

export { BaseReporter } from './src/base_reporter';
export type { BaseReporterOptions } from './src/types';
export { BaseReporter } from './src/base_reporter.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,5 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseReporter = void 0;
var base_reporter_1 = require("./src/base_reporter");
Object.defineProperty(exports, "BaseReporter", { enumerable: true, get: function () { return base_reporter_1.BaseReporter; } });
export { BaseReporter } from './src/base_reporter.js';

@@ -1,5 +0,5 @@

import type { BaseReporterOptions } from './types';
import type { BaseReporterOptions } from './types.js';
import type { Emitter, Runner, TestEndNode, SuiteEndNode, GroupEndNode, TestStartNode, RunnerEndNode, GroupStartNode, SuiteStartNode, RunnerStartNode } from '@japa/core';
export declare abstract class BaseReporter {
private options;
#private;
runner: Runner<any>;

@@ -13,3 +13,2 @@ currentFileName?: string;

constructor(options?: Partial<BaseReporterOptions>);
private printKeyValuePair;
protected onTestStart(_: TestStartNode): void;

@@ -23,6 +22,5 @@ protected onTestEnd(_: TestEndNode): void;

protected end(_: RunnerEndNode): Promise<void>;
private printAggregates;
private printErrors;
printSummary(summary: ReturnType<Runner<any>['getSummary']>): Promise<void>;
boot(runner: Runner<any>, emitter: Emitter): void;
}
//# sourceMappingURL=base_reporter.d.ts.map

@@ -1,12 +0,7 @@

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseReporter = void 0;
const ms_1 = __importDefault(require("ms"));
const cliui_1 = require("@poppinss/cliui");
const errors_printer_1 = require("@japa/errors-printer");
class BaseReporter {
options;
import ms from 'ms';
import { cliui } from '@poppinss/cliui';
import { ErrorsPrinter } from '@japa/errors-printer';
export class BaseReporter {
#options;
#ui = cliui();
runner;

@@ -17,8 +12,8 @@ currentFileName;

constructor(options = {}) {
this.options = {
this.#options = {
stackLinesCount: options.stackLinesCount || 5,
};
}
printKeyValuePair(key, value, whitespaceLength) {
console.log(`${cliui_1.logger.colors.dim(`${key.padEnd(whitespaceLength + 2)} : `)}${value}`);
#printKeyValuePair(key, value, whitespaceLength) {
console.log(`${this.#ui.colors.dim(`${key.padEnd(whitespaceLength + 2)} : `)}${value}`);
}

@@ -33,28 +28,28 @@ onTestStart(_) { }

async end(_) { }
printAggregates(summary) {
#printAggregates(summary) {
const [tests, time] = [[], []];
time.push(cliui_1.logger.colors.dim((0, ms_1.default)(summary.duration)));
time.push(this.#ui.colors.dim(ms(summary.duration)));
if (summary.aggregates.passed) {
tests.push(cliui_1.logger.colors.green(`${summary.aggregates.passed} passed`));
tests.push(this.#ui.colors.green(`${summary.aggregates.passed} passed`));
}
if (summary.aggregates.failed) {
tests.push(cliui_1.logger.colors.red(`${summary.aggregates.failed} failed`));
tests.push(this.#ui.colors.red(`${summary.aggregates.failed} failed`));
}
if (summary.aggregates.todo) {
tests.push(cliui_1.logger.colors.cyan(`${summary.aggregates.todo} todo`));
tests.push(this.#ui.colors.cyan(`${summary.aggregates.todo} todo`));
}
if (summary.aggregates.skipped) {
tests.push(cliui_1.logger.colors.yellow(`${summary.aggregates.skipped} skipped`));
tests.push(this.#ui.colors.yellow(`${summary.aggregates.skipped} skipped`));
}
if (summary.aggregates.regression) {
tests.push(cliui_1.logger.colors.magenta(`${summary.aggregates.regression} regression`));
tests.push(this.#ui.colors.magenta(`${summary.aggregates.regression} regression`));
}
const keysPadding = summary.aggregates.uncaughtExceptions ? 19 : 5;
this.printKeyValuePair('Tests', `${tests.join(', ')} ${cliui_1.logger.colors.dim(`(${summary.aggregates.total})`)}`, keysPadding);
this.printKeyValuePair('Time', time.join(''), keysPadding);
this.#printKeyValuePair('Tests', `${tests.join(', ')} ${this.#ui.colors.dim(`(${summary.aggregates.total})`)}`, keysPadding);
this.#printKeyValuePair('Time', time.join(''), keysPadding);
if (summary.aggregates.uncaughtExceptions) {
this.printKeyValuePair('Uncaught exceptions', cliui_1.logger.colors.red(String(summary.aggregates.uncaughtExceptions)), keysPadding);
this.#printKeyValuePair('Uncaught exceptions', this.#ui.colors.red(String(summary.aggregates.uncaughtExceptions)), keysPadding);
}
}
async printErrors(summary) {
async #printErrors(summary) {
if (summary.failureTree.length || this.uncaughtExceptions.length) {

@@ -64,4 +59,4 @@ console.log('');

}
const errorPrinter = new errors_printer_1.ErrorsPrinter({
stackLinesCount: this.options.stackLinesCount,
const errorPrinter = new ErrorsPrinter({
stackLinesCount: this.#options.stackLinesCount,
});

@@ -87,14 +82,14 @@ for (let suite of summary.failureTree) {

if (summary.aggregates.total === 0 && !summary.hasError) {
console.log(cliui_1.logger.colors.bgYellow().black(' NO TESTS EXECUTED '));
console.log(this.#ui.colors.bgYellow().black(' NO TESTS EXECUTED '));
return;
}
if (summary.hasError) {
console.log(cliui_1.logger.colors.bgRed().black(' FAILED '));
console.log(this.#ui.colors.bgRed().black(' FAILED '));
}
else {
console.log(cliui_1.logger.colors.bgGreen().black(' PASSED '));
console.log(this.#ui.colors.bgGreen().black(' PASSED '));
}
console.log('');
this.printAggregates(summary);
await this.printErrors(summary);
this.#printAggregates(summary);
await this.#printErrors(summary);
}

@@ -136,2 +131,1 @@ boot(runner, emitter) {

}
exports.BaseReporter = BaseReporter;
export interface BaseReporterOptions {
stackLinesCount?: number;
}
//# sourceMappingURL=types.d.ts.map

@@ -1,2 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
{
"name": "@japa/base-reporter",
"version": "1.1.2",
"description": "Base reporter to create customized testing reporters for Japa",
"type": "commonjs",
"version": "2.0.0-0",
"engines": {
"node": ">=18.16.0"
},
"main": "./build/index.js",
"type": "module",
"files": [
"index.ts",
"src",
"build/src",

@@ -12,9 +17,9 @@ "build/index.js",

],
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js"
".": "./build/index.js",
"./types": "./build/src/types.js"
},
"scripts": {
"pretest": "npm run lint",
"test": "node --require=@adonisjs/require-ts/build/register bin/test.ts",
"pretest": "npm run lint && npm run typecheck",
"test": "c8 npm run quick:test",
"clean": "del-cli build",

@@ -27,64 +32,59 @@ "compile": "npm run lint && npm run clean && tsc",

"lint": "eslint . --ext=.ts",
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"sync-labels": "github-label-sync --labels .github/labels.json @japa/base-reporter"
"quick:test": "node --loader ts-node/esm bin/test.ts",
"sync-labels": "github-label-sync --labels .github/labels.json japa/file-system"
},
"publishConfig": {
"access": "public",
"tag": "latest"
},
"keywords": [],
"author": "japa,virk",
"license": "MIT",
"devDependencies": {
"@adonisjs/require-ts": "^2.0.13",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@adonisjs/eslint-config": "^1.1.5",
"@adonisjs/prettier-config": "^1.1.5",
"@adonisjs/tsconfig": "^1.1.5",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
"@japa/assert": "^1.4.1",
"@japa/core": "^7.3.2",
"@japa/core": "^7.3.3",
"@japa/run-failed-tests": "^1.1.1",
"@japa/runner": "^2.5.1",
"@japa/spec-reporter": "^1.3.3",
"@swc/core": "^1.3.66",
"@types/ms": "^0.7.31",
"@types/node": "^18.14.5",
"@types/node": "^20.3.1",
"c8": "^8.0.0",
"del-cli": "^5.0.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-adonis": "^3.0.3",
"eslint-plugin-prettier": "^4.0.0",
"github-label-sync": "^2.2.0",
"eslint": "^8.43.0",
"github-label-sync": "^2.3.1",
"husky": "^8.0.3",
"np": "^7.6.3",
"prettier": "^2.8.4",
"typescript": "^4.9.5"
"np": "^8.0.4",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typescript": "^5.1.3"
},
"eslintConfig": {
"extends": [
"plugin:adonis/typescriptPackage",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
}
"dependencies": {
"@japa/errors-printer": "^3.0.0-0",
"@poppinss/cliui": "^6.1.1-2",
"ms": "^2.1.3"
},
"eslintIgnore": [
"build"
"author": "japa,virk",
"license": "MIT",
"homepage": "https://github.com/japa/base-reporter#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/japa/base-reporter.git"
},
"bugs": {
"url": "https://github.com/japa/base-reporter/issues"
},
"keywords": [
"japa",
"test",
"reporter"
],
"prettier": {
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
"types": "./build/index.d.ts",
"directories": {
"test": "tests"
},
"eslintConfig": {
"extends": "@adonisjs/eslint-config/package"
},
"prettier": "@adonisjs/prettier-config",
"commitlint": {

@@ -95,24 +95,21 @@ "extends": [

},
"publishConfig": {
"access": "public",
"tag": "next"
},
"np": {
"message": "chore(release): %s",
"tag": "latest",
"tag": "next",
"branch": "main",
"anyBranch": false
},
"dependencies": {
"@japa/errors-printer": "^2.1.0",
"@poppinss/cliui": "^3.0.5",
"ms": "^2.1.3"
},
"directories": {
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/japa/base-reporter.git"
},
"bugs": {
"url": "https://github.com/japa/base-reporter/issues"
},
"homepage": "https://github.com/japa/base-reporter#readme"
"c8": {
"reporter": [
"text",
"html"
],
"exclude": [
"tests/**"
]
}
}
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