Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

@commitlint/format

Package Overview
Dependencies
Maintainers
4
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/format - npm Package Compare versions

Comparing version
7.6.1
to
8.0.0
+28
lib/format.d.ts
import chalk from 'chalk';
export interface FormattableProblem {
level: 0 | 1 | 2;
name: string;
message: string;
}
export interface FormattableResult {
errors?: FormattableProblem[];
warnings?: FormattableProblem[];
}
export interface WithInput {
input?: string;
}
export interface FormattableReport {
results?: (FormattableResult & WithInput)[];
}
export declare type ChalkColor = keyof typeof chalk;
export interface FormatOptions {
color?: boolean;
signs?: readonly [string, string, string];
colors?: readonly [ChalkColor, ChalkColor, ChalkColor];
verbose?: boolean;
helpUrl?: string;
}
export declare function format(report?: FormattableReport, options?: FormatOptions): string;
export declare function formatResult(result?: FormattableResult, options?: FormatOptions): string[];
export default format;
//# sourceMappingURL=format.d.ts.map
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,CAAC,EAAE,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,CAAC;CAC5C;AAED,oBAAY,UAAU,GAAG,MAAM,OAAO,KAAK,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,MAAM,CACrB,MAAM,GAAE,iBAAsB,EAC9B,OAAO,GAAE,aAAkB,UAY3B;AAyBD,wBAAgB,YAAY,CAC3B,MAAM,GAAE,iBAAsB,EAC9B,OAAO,GAAE,aAAkB,GACzB,MAAM,EAAE,CA2CV;AAED,eAAe,MAAM,CAAC"}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
var chalk_1 = __importDefault(require("chalk"));
var DEFAULT_SIGNS = [' ', '⚠', '✖'];
var DEFAULT_COLORS = ['white', 'yellow', 'red'];
function format(report, options) {
if (report === void 0) { report = {}; }
if (options === void 0) { options = {}; }
var _a = report.results, results = _a === void 0 ? [] : _a;
var fi = function (result) {
return formatInput(result, options);
};
var fr = function (result) { return formatResult(result, options); };
return results
.filter(function (r) { return Array.isArray(r.warnings) || Array.isArray(r.errors); })
.map(function (result) { return fi(result).concat(fr(result)); })
.reduce(function (acc, item) { return Array.isArray(item) ? acc.concat(item) : acc.concat([item]); }, [])
.join('\n');
}
exports.format = format;
function formatInput(result, options) {
if (options === void 0) { options = {}; }
var _a = options.color, enabled = _a === void 0 ? true : _a;
var _b = result.errors, errors = _b === void 0 ? [] : _b, _c = result.warnings, warnings = _c === void 0 ? [] : _c, _d = result.input, input = _d === void 0 ? '' : _d;
if (!input) {
return [''];
}
var sign = '⧗';
var decoration = enabled ? chalk_1["default"].gray(sign) : sign;
var commitText = errors.length > 0 ? input : input.split('\n')[0];
var decoratedInput = enabled ? chalk_1["default"].bold(commitText) : commitText;
var hasProblems = errors.length > 0 || warnings.length > 0;
return options.verbose || hasProblems
? [decoration + " input: " + decoratedInput]
: [];
}
function formatResult(result, options) {
if (result === void 0) { result = {}; }
if (options === void 0) { options = {}; }
var _a = options.signs, signs = _a === void 0 ? DEFAULT_SIGNS : _a, _b = options.colors, colors = _b === void 0 ? DEFAULT_COLORS : _b, _c = options.color, enabled = _c === void 0 ? true : _c;
var _d = result.errors, errors = _d === void 0 ? [] : _d, _e = result.warnings, warnings = _e === void 0 ? [] : _e;
var problems = errors.concat(warnings).map(function (problem) {
var sign = signs[problem.level] || '';
var color = colors[problem.level] || 'white';
var decoration = enabled ? chalk_1["default"][color](sign) : sign;
var name = enabled
? chalk_1["default"].grey("[" + problem.name + "]")
: "[" + problem.name + "]";
return decoration + " " + problem.message + " " + name;
});
var sign = selectSign(result);
var color = selectColor(result);
var deco = enabled ? chalk_1["default"][color](sign) : sign;
var el = errors.length;
var wl = warnings.length;
var hasProblems = problems.length > 0;
var summary = options.verbose || hasProblems
? deco + " found " + el + " problems, " + wl + " warnings"
: undefined;
var fmtSummary = enabled && typeof summary === 'string' ? chalk_1["default"].bold(summary) : summary;
var help = hasProblems ? "\u24D8 Get help: " + options.helpUrl : undefined;
return problems.concat([
hasProblems ? '' : undefined,
fmtSummary,
help,
help ? '' : undefined
]).filter(function (line) { return typeof line === 'string'; });
}
exports.formatResult = formatResult;
exports["default"] = format;
function selectSign(result) {
if ((result.errors || []).length > 0) {
return '✖';
}
return (result.warnings || []).length ? '⚠' : '✔';
}
function selectColor(result) {
if ((result.errors || []).length > 0) {
return 'red';
}
return (result.warnings || []).length ? 'yellow' : 'green';
}
//# sourceMappingURL=format.js.map
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAE1B,IAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC/C,IAAM,cAAc,GAAG,CAA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CAAC,CAAC,SAAS;OACpB,MAAM,CAAC,UAAC,IAAI,IAAqB,OAAA,OAAO,IAAI,KAAK,QAAQ,EAAxB,CAAwB,CAAC,CAAC;AAC9D,CAAC;AA9CD,oCA8CC;AAED,qBAAe,MAAM,CAAC;AAEtB,SAAS,UAAU,CAAC,MAAyB;IAC5C,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,OAAO,GAAG,CAAC;KACX;IACD,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnD,CAAC;AAED,SAAS,WAAW,CAAC,MAAyB;IAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK,CAAC;KACb;IACD,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5D,CAAC"}
export { default } from './format';
export * from './format';
//# sourceMappingURL=index.d.ts.map
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC"}
+7
-92

@@ -1,94 +0,9 @@

'use strict';
var _chalk = require('chalk');
var _chalk2 = _interopRequireDefault(_chalk);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const DEFAULT_SIGNS = [' ', '⚠', '✖'];
const DEFAULT_COLORS = ['white', 'yellow', 'red'];
module.exports = format;
module.exports.default = format;
module.exports.format = format;
module.exports.formatResult = formatResult;
function format(report = {}, options = {}) {
var _report$results = report.results;
const results = _report$results === undefined ? [] : _report$results;
if (results.length > 0) {
return results.map(result => `${formatInput(result, options)}${formatResult(result, options).join('\n')}`).join('\n');
}
// Output a summary when nothing is found
return formatResult({}, options).join('\n');
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
function formatInput(result = {}, options = {}) {
var _options$color = options.color;
const enabled = _options$color === undefined ? true : _options$color;
var _result$errors = result.errors;
const errors = _result$errors === undefined ? [] : _result$errors;
var _result$input = result.input;
const input = _result$input === undefined ? '' : _result$input;
if (!input) {
return '';
}
const sign = '⧗';
const decoration = enabled ? _chalk2.default.gray(sign) : sign;
const commitText = errors.length > 0 ? input : input.split('\n')[0];
const decoratedInput = enabled ? _chalk2.default.bold(commitText) : commitText;
return `\n${decoration} input: ${decoratedInput}\n`;
}
function formatResult(result = {}, options = {}) {
var _options$signs = options.signs;
const signs = _options$signs === undefined ? DEFAULT_SIGNS : _options$signs;
var _options$colors = options.colors;
const colors = _options$colors === undefined ? DEFAULT_COLORS : _options$colors;
var _options$color2 = options.color;
const enabled = _options$color2 === undefined ? true : _options$color2;
var _result$errors2 = result.errors;
const errors = _result$errors2 === undefined ? [] : _result$errors2;
var _result$warnings = result.warnings;
const warnings = _result$warnings === undefined ? [] : _result$warnings;
const problems = [...errors, ...warnings].map(problem => {
const sign = signs[problem.level] || '';
const color = colors[problem.level] || 'white';
const decoration = enabled ? _chalk2.default[color](sign) : sign;
const name = enabled ? _chalk2.default.grey(`[${problem.name}]`) : `[${problem.name}]`;
return `${decoration} ${problem.message} ${name}`;
});
const sign = selectSign({ errors, warnings });
const color = selectColor({ errors, warnings });
const decoration = enabled ? _chalk2.default[color](sign) : sign;
const summary = `${decoration} found ${errors.length} problems, ${warnings.length} warnings \n (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )\n\n`;
return [...problems, enabled ? _chalk2.default.bold(summary) : summary];
}
function selectSign(result) {
if (result.errors.length > 0) {
return '✖';
}
return result.warnings.length ? '⚠' : '✔';
}
function selectColor(result) {
if (result.errors.length > 0) {
return 'red';
}
return result.warnings.length ? 'yellow' : 'green';
}
exports.__esModule = true;
var format_1 = require("./format");
exports["default"] = format_1["default"];
__export(require("./format"));
//# sourceMappingURL=index.js.map

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

{"version":3,"sources":["../src/index.js"],"names":["DEFAULT_SIGNS","DEFAULT_COLORS","module","exports","format","default","formatResult","report","options","results","length","map","result","formatInput","join","color","enabled","errors","input","sign","decoration","gray","commitText","split","decoratedInput","bold","signs","colors","warnings","problems","problem","level","name","grey","message","selectSign","selectColor","summary"],"mappings":";;AAAA;;;;;;AAEA,MAAMA,gBAAgB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAtB;AACA,MAAMC,iBAAiB,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAAvB;;AAEAC,OAAOC,OAAP,GAAiBC,MAAjB;AACAF,OAAOC,OAAP,CAAeE,OAAf,GAAyBD,MAAzB;AACAF,OAAOC,OAAP,CAAeC,MAAf,GAAwBA,MAAxB;AACAF,OAAOC,OAAP,CAAeG,YAAf,GAA8BA,YAA9B;;AAEA,SAASF,MAAT,CAAgBG,SAAS,EAAzB,EAA6BC,UAAU,EAAvC,EAA2C;AAAA,uBACnBD,MADmB,CACnCE,OADmC;AAAA,OACnCA,OADmC,mCACzB,EADyB;;;AAG1C,KAAIA,QAAQC,MAAR,GAAiB,CAArB,EAAwB;AACvB,SAAOD,QACLE,GADK,CAELC,UACE,GAAEC,YAAYD,MAAZ,EAAoBJ,OAApB,CAA6B,GAAEF,aAAaM,MAAb,EAAqBJ,OAArB,EAA8BM,IAA9B,CACjC,IADiC,CAEhC,EALE,EAOLA,IAPK,CAOA,IAPA,CAAP;AAQA;;AAED;AACA,QAAOR,aAAa,EAAb,EAAiBE,OAAjB,EAA0BM,IAA1B,CAA+B,IAA/B,CAAP;AACA;;AAED,SAASD,WAAT,CAAqBD,SAAS,EAA9B,EAAkCJ,UAAU,EAA5C,EAAgD;AAAA,sBACfA,OADe,CACxCO,KADwC;AAAA,OACjCC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ACA,QAAMX,aAAaJ,UAAU,gBAAMD,KAAN,EAAaI,IAAb,CAAV,GAA+BA,IAAlD;AACA,QAAMa,OAAOhB,UACV,gBAAMiB,IAAN,CAAY,IAAGH,QAAQE,IAAK,GAA5B,CADU,GAET,IAAGF,QAAQE,IAAK,GAFpB;AAGA,SAAQ,GAAEZ,UAAW,MAAKU,QAAQI,OAAQ,IAAGF,IAAK,EAAlD;AACA,EARgB,CAAjB;;AAUA,OAAMb,OAAOgB,WAAW,EAAClB,MAAD,EAASW,QAAT,EAAX,CAAb;AACA,OAAMb,QAAQqB,YAAY,EAACnB,MAAD,EAASW,QAAT,EAAZ,CAAd;;AAEA,OAAMR,aAAaJ,UAAU,gBAAMD,KAAN,EAAaI,IAAb,CAAV,GAA+BA,IAAlD;AACA,OAAMkB,UAAW,GAAEjB,UAAW,YAAWH,OAAOP,MAAO,cACtDkB,SAASlB,MACT,8GAFD;AAGA,QAAO,CAAC,GAAGmB,QAAJ,EAAcb,UAAU,gBAAMS,IAAN,CAAWY,OAAX,CAAV,GAAgCA,OAA9C,CAAP;AACA;;AAED,SAASF,UAAT,CAAoBvB,MAApB,EAA4B;AAC3B,KAAIA,OAAOK,MAAP,CAAcP,MAAd,GAAuB,CAA3B,EAA8B;AAC7B,SAAO,GAAP;AACA;AACD,QAAOE,OAAOgB,QAAP,CAAgBlB,MAAhB,GAAyB,GAAzB,GAA+B,GAAtC;AACA;;AAED,SAAS0B,WAAT,CAAqBxB,MAArB,EAA6B;AAC5B,KAAIA,OAAOK,MAAP,CAAcP,MAAd,GAAuB,CAA3B,EAA8B;AAC7B,SAAO,KAAP;AACA;AACD,QAAOE,OAAOgB,QAAP,CAAgBlB,MAAhB,GAAyB,QAAzB,GAAoC,OAA3C;AACA","file":"index.js","sourcesContent":["import chalk from 'chalk';\n\nconst DEFAULT_SIGNS = [' ', '⚠', '✖'];\nconst DEFAULT_COLORS = ['white', 'yellow', 'red'];\n\nmodule.exports = format;\nmodule.exports.default = format;\nmodule.exports.format = format;\nmodule.exports.formatResult = formatResult;\n\nfunction format(report = {}, options = {}) {\n\tconst {results = []} = report;\n\n\tif (results.length > 0) {\n\t\treturn results\n\t\t\t.map(\n\t\t\t\tresult =>\n\t\t\t\t\t`${formatInput(result, options)}${formatResult(result, options).join(\n\t\t\t\t\t\t'\\n'\n\t\t\t\t\t)}`\n\t\t\t)\n\t\t\t.join('\\n');\n\t}\n\n\t// Output a summary when nothing is found\n\treturn formatResult({}, options).join('\\n');\n}\n\nfunction formatInput(result = {}, options = {}) {\n\tconst {color: enabled = true} = options;\n\tconst {errors = [], input = ''} = result;\n\n\tif (!input) {\n\t\treturn '';\n\t}\n\n\tconst sign = '⧗';\n\tconst decoration = enabled ? chalk.gray(sign) : sign;\n\tconst commitText = errors.length > 0 ? input : input.split('\\n')[0];\n\n\tconst decoratedInput = enabled ? chalk.bold(commitText) : commitText;\n\n\treturn `\\n${decoration} input: ${decoratedInput}\\n`;\n}\n\nfunction formatResult(result = {}, options = {}) {\n\tconst {\n\t\tsigns = DEFAULT_SIGNS,\n\t\tcolors = DEFAULT_COLORS,\n\t\tcolor: enabled = true\n\t} = options;\n\tconst {errors = [], warnings = []} = result;\n\n\tconst problems = [...errors, ...warnings].map(problem => {\n\t\tconst sign = signs[problem.level] || '';\n\t\tconst color = colors[problem.level] || 'white';\n\t\tconst decoration = enabled ? chalk[color](sign) : sign;\n\t\tconst name = enabled\n\t\t\t? chalk.grey(`[${problem.name}]`)\n\t\t\t: `[${problem.name}]`;\n\t\treturn `${decoration} ${problem.message} ${name}`;\n\t});\n\n\tconst sign = selectSign({errors, warnings});\n\tconst color = selectColor({errors, warnings});\n\n\tconst decoration = enabled ? chalk[color](sign) : sign;\n\tconst summary = `${decoration} found ${errors.length} problems, ${\n\t\twarnings.length\n\t} warnings \\n (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )\\n\\n`;\n\treturn [...problems, enabled ? chalk.bold(summary) : summary];\n}\n\nfunction selectSign(result) {\n\tif (result.errors.length > 0) {\n\t\treturn '✖';\n\t}\n\treturn result.warnings.length ? '⚠' : '✔';\n}\n\nfunction selectColor(result) {\n\tif (result.errors.length > 0) {\n\t\treturn 'red';\n\t}\n\treturn result.warnings.length ? 'yellow' : 'green';\n}\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,mCAAmC;AAA1B,8BAAA,SAAO,EAAA;AAChB,8BAAyB"}
{
"name": "@commitlint/format",
"version": "7.6.1",
"version": "8.0.0",
"description": "Format commitlint reports",

@@ -10,28 +10,9 @@ "main": "lib/index.js",

"scripts": {
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
"build": "tsc",
"deps": "dep-check",
"pkg": "pkg-check --skip-import",
"start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
"test": "ava -c 4 --verbose",
"watch": "babel src --out-dir lib --watch --source-maps"
"start": "concurrently \"yarn test --watchAll\" \"yarn run watch\"",
"test": "jest",
"watch": "tsc -w"
},
"ava": {
"files": [
"src/**/*.test.js",
"!lib/**/*"
],
"source": [
"src/**/*.js",
"!lib/**/*"
],
"babel": "inherit",
"require": [
"babel-register"
]
},
"babel": {
"presets": [
"babel-preset-commitlint"
]
},
"engines": {

@@ -60,17 +41,17 @@ "node": ">=4"

"devDependencies": {
"@commitlint/test": "^7.6.0",
"@commitlint/utils": "^7.6.0",
"ava": "0.22.0",
"babel-cli": "6.26.0",
"babel-preset-commitlint": "^7.6.0",
"babel-register": "6.26.0",
"@commitlint/test": "^8.0.0",
"@commitlint/utils": "^8.0.0",
"@types/jest": "24.0.12",
"@types/lodash": "4.14.123",
"concurrently": "3.5.1",
"cross-env": "5.1.1",
"lodash": "4.17.11"
"jest": "24.7.1",
"rimraf": "2.6.1",
"ts-jest": "24.0.2",
"typescript": "3.4.5"
},
"dependencies": {
"babel-runtime": "^6.23.0",
"chalk": "^2.0.1"
},
"gitHead": "dc5619dea62b7b8ac72dc7758d70b684e010557b"
"gitHead": "29d1cee10ee7734a85d97ef039c4ce2da633628c"
}
'use strict';
var _ava = require('ava');
var _ava2 = _interopRequireDefault(_ava);
var _chalk = require('chalk');
var _chalk2 = _interopRequireDefault(_chalk);
var _lodash = require('lodash');
var _ = require('.');
var _2 = _interopRequireDefault(_);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const ok = _chalk2.default.bold(`${_chalk2.default.green('✔')} found 0 problems, 0 warnings \n (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )\n\n`);
(0, _ava2.default)('does nothing without arguments', t => {
const actual = (0, _2.default)();
t.deepEqual(actual, ok);
});
(0, _ava2.default)('does nothing without report results', t => {
const actual = (0, _2.default)({ results: [] });
t.deepEqual(actual, ok);
});
(0, _ava2.default)('does nothing without .errors and .warnings', t => {
const actual = (0, _2.default)({ results: [{}] });
t.deepEqual(actual, ok);
});
(0, _ava2.default)('returns empty summary of problems for empty .errors and .warnings', t => {
const actual = (0, _2.default)({
results: [{
errors: [],
warnings: []
}]
});
t.true(actual.includes('0 problems, 0 warnings'));
});
(0, _ava2.default)('returns a correct of empty .errors and .warnings', t => {
const actualError = (0, _2.default)({
results: [{
errors: [{
level: 2,
name: 'error-name',
message: 'There was an error'
}]
}]
});
const actualWarning = (0, _2.default)({
results: [{
warnings: [{
level: 1,
name: 'warning-name',
message: 'There was a problem'
}]
}]
});
t.true((0, _lodash.includes)(actualError, 'There was an error'));
t.true((0, _lodash.includes)(actualError, '1 problems, 0 warnings'));
t.true((0, _lodash.includes)(actualWarning, 'There was a problem'));
t.true((0, _lodash.includes)(actualWarning, '0 problems, 1 warnings'));
});
(0, _ava2.default)('uses appropriate signs by default', t => {
const actualError = (0, _2.default)({
results: [{
errors: [{
level: 2,
name: 'error-name',
message: 'There was an error'
}]
}]
});
const actualWarning = (0, _2.default)({
results: [{
warnings: [{
level: 1,
name: 'warning-name',
message: 'There was a problem'
}]
}]
});
t.true((0, _lodash.includes)(actualError, '✖'));
t.true((0, _lodash.includes)(actualWarning, '⚠'));
});
(0, _ava2.default)('uses signs as configured', t => {
const options = { signs: ['HNT', 'WRN', 'ERR'] };
const actualError = (0, _2.default)({
results: [{
errors: [{
level: 2,
name: 'error-name',
message: 'There was an error'
}]
}]
}, options);
const actualWarning = (0, _2.default)({
results: [{
warnings: [{
level: 1,
name: 'warning-name',
message: 'There was a problem'
}]
}]
}, options);
t.true((0, _lodash.includes)(actualError, 'ERR'));
t.true((0, _lodash.includes)(actualWarning, 'WRN'));
});
(0, _ava2.default)('format result provides summary without arguments', t => {
const actual = (0, _.formatResult)();
const actualText = actual.join('\n');
t.true((0, _lodash.includes)(actualText, '0 problems, 0 warnings'));
});
(0, _ava2.default)('format result transforms error to text', t => {
const actual = (0, _.formatResult)({
errors: [{
level: 2,
name: 'error-name',
message: 'There was an error'
}]
});
const actualText = actual.join('\n');
t.true((0, _lodash.includes)(actualText, 'error-name'));
t.true((0, _lodash.includes)(actualText, 'There was an error'));
t.true((0, _lodash.includes)(actualText, '1 problems, 0 warnings'));
});
(0, _ava2.default)('format result transforms warning to text', t => {
const actual = (0, _.formatResult)({
warnings: [{
level: 1,
name: 'warning-name',
message: 'There was a warning'
}]
});
const actualText = actual.join('\n');
t.true((0, _lodash.includes)(actualText, 'warning-name'));
t.true((0, _lodash.includes)(actualText, 'There was a warning'));
t.true((0, _lodash.includes)(actualText, '0 problems, 1 warnings'));
});
//# sourceMappingURL=index.test.js.map
{"version":3,"sources":["../src/index.test.js"],"names":["ok","bold","green","t","actual","deepEqual","results","errors","warnings","true","includes","actualError","level","name","message","actualWarning","options","signs","actualText","join"],"mappings":";;AAAA;;;;AACA;;;;AACA;;AACA;;;;;;AAEA,MAAMA,KAAK,gBAAMC,IAAN,CACT,GAAE,gBAAMC,KAAN,CACF,GADE,CAED,oIAHQ,CAAX;;AAMA,mBAAK,gCAAL,EAAuCC,KAAK;AAC3C,OAAMC,SAAS,iBAAf;AACAD,GAAEE,SAAF,CAAYD,MAAZ,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,SAAS,oBAAa;AAC3BG,UAAQ,CACP;AACCK,UAAO,CADR;AAECC,SAAM,YAFP;AAGCC,YAAS;AAHV,GADO;AADmB,EAAb,CAAf;;AAUA,OAAMI,aAAad,OAAOe,IAAP,CAAY,IAAZ,CAAnB;;AAEAhB,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,YAArB,CAAP;AACAf,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,oBAArB,CAAP;AACAf,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,wBAArB,CAAP;AACA,CAhBD;;AAkBA,mBAAK,0CAAL,EAAiDf,KAAK;AACrD,OAAMC,SAAS,oBAAa;AAC3BI,YAAU,CACT;AACCI,UAAO,CADR;AAECC,SAAM,cAFP;AAGCC,YAAS;AAHV,GADS;AADiB,EAAb,CAAf;;AAUA,OAAMI,aAAad,OAAOe,IAAP,CAAY,IAAZ,CAAnB;;AAEAhB,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,cAArB,CAAP;AACAf,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,qBAArB,CAAP;AACAf,GAAEM,IAAF,CAAO,sBAASS,UAAT,EAAqB,wBAArB,CAAP;AACA,CAhBD","file":"index.test.js","sourcesContent":["import test from 'ava';\nimport chalk from 'chalk';\nimport {includes} from 'lodash';\nimport format, {formatResult} from '.';\n\nconst ok = chalk.bold(\n\t`${chalk.green(\n\t\t'✔'\n\t)} found 0 problems, 0 warnings \\n (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )\\n\\n`\n);\n\ntest('does nothing without arguments', t => {\n\tconst actual = format();\n\tt.deepEqual(actual, ok);\n});\n\ntest('does nothing without report results', t => {\n\tconst actual = format({results: []});\n\tt.deepEqual(actual, ok);\n});\n\ntest('does nothing without .errors and .warnings', t => {\n\tconst actual = format({results: [{}]});\n\tt.deepEqual(actual, ok);\n});\n\ntest('returns empty summary of problems for empty .errors and .warnings', t => {\n\tconst actual = format({\n\t\tresults: [\n\t\t\t{\n\t\t\t\terrors: [],\n\t\t\t\twarnings: []\n\t\t\t}\n\t\t]\n\t});\n\n\tt.true(actual.includes('0 problems, 0 warnings'));\n});\n\ntest('returns a correct of empty .errors and .warnings', t => {\n\tconst actualError = format({\n\t\tresults: [\n\t\t\t{\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlevel: 2,\n\t\t\t\t\t\tname: 'error-name',\n\t\t\t\t\t\tmessage: 'There was an error'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t});\n\n\tconst actualWarning = format({\n\t\tresults: [\n\t\t\t{\n\t\t\t\twarnings: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlevel: 1,\n\t\t\t\t\t\tname: 'warning-name',\n\t\t\t\t\t\tmessage: 'There was a problem'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t});\n\n\tt.true(includes(actualError, 'There was an error'));\n\tt.true(includes(actualError, '1 problems, 0 warnings'));\n\tt.true(includes(actualWarning, 'There was a problem'));\n\tt.true(includes(actualWarning, '0 problems, 1 warnings'));\n});\n\ntest('uses appropriate signs by default', t => {\n\tconst actualError = format({\n\t\tresults: [\n\t\t\t{\n\t\t\t\terrors: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlevel: 2,\n\t\t\t\t\t\tname: 'error-name',\n\t\t\t\t\t\tmessage: 'There was an error'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t});\n\n\tconst actualWarning = format({\n\t\tresults: [\n\t\t\t{\n\t\t\t\twarnings: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlevel: 1,\n\t\t\t\t\t\tname: 'warning-name',\n\t\t\t\t\t\tmessage: 'There was a problem'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t});\n\n\tt.true(includes(actualError, '✖'));\n\tt.true(includes(actualWarning, '⚠'));\n});\n\ntest('uses signs as configured', t => {\n\tconst options = {signs: ['HNT', 'WRN', 'ERR']};\n\tconst actualError = format(\n\t\t{\n\t\t\tresults: [\n\t\t\t\t{\n\t\t\t\t\terrors: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlevel: 2,\n\t\t\t\t\t\t\tname: 'error-name',\n\t\t\t\t\t\t\tmessage: 'There was an error'\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\toptions\n\t);\n\n\tconst actualWarning = format(\n\t\t{\n\t\t\tresults: [\n\t\t\t\t{\n\t\t\t\t\twarnings: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlevel: 1,\n\t\t\t\t\t\t\tname: 'warning-name',\n\t\t\t\t\t\t\tmessage: 'There was a problem'\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\toptions\n\t);\n\n\tt.true(includes(actualError, 'ERR'));\n\tt.true(includes(actualWarning, 'WRN'));\n});\n\ntest('format result provides summary without arguments', t => {\n\tconst actual = formatResult();\n\tconst actualText = actual.join('\\n');\n\n\tt.true(includes(actualText, '0 problems, 0 warnings'));\n});\n\ntest('format result transforms error to text', t => {\n\tconst actual = formatResult({\n\t\terrors: [\n\t\t\t{\n\t\t\t\tlevel: 2,\n\t\t\t\tname: 'error-name',\n\t\t\t\tmessage: 'There was an error'\n\t\t\t}\n\t\t]\n\t});\n\n\tconst actualText = actual.join('\\n');\n\n\tt.true(includes(actualText, 'error-name'));\n\tt.true(includes(actualText, 'There was an error'));\n\tt.true(includes(actualText, '1 problems, 0 warnings'));\n});\n\ntest('format result transforms warning to text', t => {\n\tconst actual = formatResult({\n\t\twarnings: [\n\t\t\t{\n\t\t\t\tlevel: 1,\n\t\t\t\tname: 'warning-name',\n\t\t\t\tmessage: 'There was a warning'\n\t\t\t}\n\t\t]\n\t});\n\n\tconst actualText = actual.join('\\n');\n\n\tt.true(includes(actualText, 'warning-name'));\n\tt.true(includes(actualText, 'There was a warning'));\n\tt.true(includes(actualText, '0 problems, 1 warnings'));\n});\n"]}