@commitlint/format 7.5.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.1.0](https://github.com/conventional-changelog/commitlint/compare/v8.0.0...v8.1.0) (2019-07-15)
7
+
8
+ **Note:** Version bump only for package @commitlint/format
9
+
10
+
11
+
12
+
13
+
14
+ ## [7.6.1](https://github.com/conventional-changelog/commitlint/compare/v7.6.0...v7.6.1) (2019-05-09)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * ensure format() is available as commonjs default export [#645](https://github.com/conventional-changelog/commitlint/issues/645) ([ec3da92](https://github.com/conventional-changelog/commitlint/commit/ec3da92))
20
+
21
+
22
+
23
+
24
+
25
+ # [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * avoid excessive help text [#606](https://github.com/conventional-changelog/commitlint/issues/606) ([#637](https://github.com/conventional-changelog/commitlint/issues/637)) ([8f3c3b1](https://github.com/conventional-changelog/commitlint/commit/8f3c3b1))
31
+
32
+
33
+
34
+
35
+
6
36
  <a name="7.5.0"></a>
7
37
  # [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
8
38
 
@@ -0,0 +1,28 @@
1
+ import chalk from 'chalk';
2
+ export interface FormattableProblem {
3
+ level: 0 | 1 | 2;
4
+ name: string;
5
+ message: string;
6
+ }
7
+ export interface FormattableResult {
8
+ errors?: FormattableProblem[];
9
+ warnings?: FormattableProblem[];
10
+ }
11
+ export interface WithInput {
12
+ input?: string;
13
+ }
14
+ export interface FormattableReport {
15
+ results?: (FormattableResult & WithInput)[];
16
+ }
17
+ export declare type ChalkColor = keyof typeof chalk;
18
+ export interface FormatOptions {
19
+ color?: boolean;
20
+ signs?: readonly [string, string, string];
21
+ colors?: readonly [ChalkColor, ChalkColor, ChalkColor];
22
+ verbose?: boolean;
23
+ helpUrl?: string;
24
+ }
25
+ export declare function format(report?: FormattableReport, options?: FormatOptions): string;
26
+ export declare function formatResult(result?: FormattableResult, options?: FormatOptions): string[];
27
+ export default format;
28
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"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,UAe3B;AAyBD,wBAAgB,YAAY,CAC3B,MAAM,GAAE,iBAAsB,EAC9B,OAAO,GAAE,aAAkB,GACzB,MAAM,EAAE,CA2CV;AAED,eAAe,MAAM,CAAC"}
package/lib/format.js ADDED
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ exports.__esModule = true;
6
+ var chalk_1 = __importDefault(require("chalk"));
7
+ var DEFAULT_SIGNS = [' ', '⚠', '✖'];
8
+ var DEFAULT_COLORS = ['white', 'yellow', 'red'];
9
+ function format(report, options) {
10
+ if (report === void 0) { report = {}; }
11
+ if (options === void 0) { options = {}; }
12
+ var _a = report.results, results = _a === void 0 ? [] : _a;
13
+ var fi = function (result) {
14
+ return formatInput(result, options);
15
+ };
16
+ var fr = function (result) { return formatResult(result, options); };
17
+ return results
18
+ .filter(function (r) { return Array.isArray(r.warnings) || Array.isArray(r.errors); })
19
+ .map(function (result) { return fi(result).concat(fr(result)); })
20
+ .reduce(function (acc, item) { return (Array.isArray(item) ? acc.concat(item) : acc.concat([item])); }, [])
21
+ .join('\n');
22
+ }
23
+ exports.format = format;
24
+ function formatInput(result, options) {
25
+ if (options === void 0) { options = {}; }
26
+ var _a = options.color, enabled = _a === void 0 ? true : _a;
27
+ 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;
28
+ if (!input) {
29
+ return [''];
30
+ }
31
+ var sign = '⧗';
32
+ var decoration = enabled ? chalk_1["default"].gray(sign) : sign;
33
+ var commitText = errors.length > 0 ? input : input.split('\n')[0];
34
+ var decoratedInput = enabled ? chalk_1["default"].bold(commitText) : commitText;
35
+ var hasProblems = errors.length > 0 || warnings.length > 0;
36
+ return options.verbose || hasProblems
37
+ ? [decoration + " input: " + decoratedInput]
38
+ : [];
39
+ }
40
+ function formatResult(result, options) {
41
+ if (result === void 0) { result = {}; }
42
+ if (options === void 0) { options = {}; }
43
+ 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;
44
+ var _d = result.errors, errors = _d === void 0 ? [] : _d, _e = result.warnings, warnings = _e === void 0 ? [] : _e;
45
+ var problems = errors.concat(warnings).map(function (problem) {
46
+ var sign = signs[problem.level] || '';
47
+ var color = colors[problem.level] || 'white';
48
+ var decoration = enabled ? chalk_1["default"][color](sign) : sign;
49
+ var name = enabled
50
+ ? chalk_1["default"].grey("[" + problem.name + "]")
51
+ : "[" + problem.name + "]";
52
+ return decoration + " " + problem.message + " " + name;
53
+ });
54
+ var sign = selectSign(result);
55
+ var color = selectColor(result);
56
+ var deco = enabled ? chalk_1["default"][color](sign) : sign;
57
+ var el = errors.length;
58
+ var wl = warnings.length;
59
+ var hasProblems = problems.length > 0;
60
+ var summary = options.verbose || hasProblems
61
+ ? deco + " found " + el + " problems, " + wl + " warnings"
62
+ : undefined;
63
+ var fmtSummary = enabled && typeof summary === 'string' ? chalk_1["default"].bold(summary) : summary;
64
+ var help = hasProblems ? "\u24D8 Get help: " + options.helpUrl : undefined;
65
+ return problems.concat([
66
+ hasProblems ? '' : undefined,
67
+ fmtSummary,
68
+ help,
69
+ help ? '' : undefined
70
+ ]).filter(function (line) { return typeof line === 'string'; });
71
+ }
72
+ exports.formatResult = formatResult;
73
+ exports["default"] = format;
74
+ function selectSign(result) {
75
+ if ((result.errors || []).length > 0) {
76
+ return '✖';
77
+ }
78
+ return (result.warnings || []).length ? '⚠' : '✔';
79
+ }
80
+ function selectColor(result) {
81
+ if ((result.errors || []).length > 0) {
82
+ return 'red';
83
+ }
84
+ return (result.warnings || []).length ? 'yellow' : 'green';
85
+ }
86
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.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AAC;IAE1E,OACI,QAAQ;QACX,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC5B,UAAU;QACV,IAAI;QACJ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,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"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { default } from './format';
2
+ export * from './format';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AACjC,cAAc,UAAU,CAAC"}
package/lib/index.js CHANGED
@@ -1,95 +1,9 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = format;
7
-
8
- var _chalk = require('chalk');
9
-
10
- var _chalk2 = _interopRequireDefault(_chalk);
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const DEFAULT_SIGNS = [' ', '⚠', '✖'];
15
- const DEFAULT_COLORS = ['white', 'yellow', 'red'];
16
-
17
- function format(report = {}, options = {}) {
18
- var _report$results = report.results;
19
- const results = _report$results === undefined ? [] : _report$results;
20
-
21
-
22
- if (results.length > 0) {
23
- return results.map(result => `${formatInput(result, options)}${formatResult(result, options).join('\n')}`).join('\n');
24
- }
25
-
26
- // Output a summary when nothing is found
27
- return formatResult({}, options).join('\n');
28
- }
29
-
30
- function formatInput(result = {}, options = {}) {
31
- var _options$color = options.color;
32
- const enabled = _options$color === undefined ? true : _options$color;
33
- var _result$errors = result.errors;
34
- const errors = _result$errors === undefined ? [] : _result$errors;
35
- var _result$input = result.input;
36
- const input = _result$input === undefined ? '' : _result$input;
37
-
38
-
39
- if (!input) {
40
- return '';
41
- }
42
-
43
- const sign = '⧗';
44
- const decoration = enabled ? _chalk2.default.gray(sign) : sign;
45
- const commitText = errors.length > 0 ? input : input.split('\n')[0];
46
-
47
- const decoratedInput = enabled ? _chalk2.default.bold(commitText) : commitText;
48
-
49
- return `\n${decoration} input: ${decoratedInput}\n`;
50
- }
51
-
52
- function formatResult(result = {}, options = {}) {
53
- var _options$signs = options.signs;
54
- const signs = _options$signs === undefined ? DEFAULT_SIGNS : _options$signs;
55
- var _options$colors = options.colors;
56
- const colors = _options$colors === undefined ? DEFAULT_COLORS : _options$colors;
57
- var _options$color2 = options.color;
58
- const enabled = _options$color2 === undefined ? true : _options$color2;
59
- var _result$errors2 = result.errors;
60
- const errors = _result$errors2 === undefined ? [] : _result$errors2;
61
- var _result$warnings = result.warnings;
62
- const warnings = _result$warnings === undefined ? [] : _result$warnings;
63
-
64
-
65
- const problems = [...errors, ...warnings].map(problem => {
66
- const sign = signs[problem.level] || '';
67
- const color = colors[problem.level] || 'white';
68
- const decoration = enabled ? _chalk2.default[color](sign) : sign;
69
- const name = enabled ? _chalk2.default.grey(`[${problem.name}]`) : `[${problem.name}]`;
70
- return `${decoration} ${problem.message} ${name}`;
71
- });
72
-
73
- const sign = selectSign({ errors, warnings });
74
- const color = selectColor({ errors, warnings });
75
-
76
- const decoration = enabled ? _chalk2.default[color](sign) : sign;
77
- const summary = `${decoration} found ${errors.length} problems, ${warnings.length} warnings \n (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )\n\n`;
78
- return [...problems, enabled ? _chalk2.default.bold(summary) : summary];
79
- }
80
-
81
- function selectSign(result) {
82
- if (result.errors.length > 0) {
83
- return '✖';
84
- }
85
- return result.warnings.length ? '⚠' : '✔';
86
- }
87
-
88
- function selectColor(result) {
89
- if (result.errors.length > 0) {
90
- return 'red';
91
- }
92
- return result.warnings.length ? 'yellow' : 'green';
93
- }
94
- module.exports = exports['default'];
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ exports.__esModule = true;
6
+ var format_1 = require("./format");
7
+ exports["default"] = format_1["default"];
8
+ __export(require("./format"));
95
9
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.js"],"names":["format","DEFAULT_SIGNS","DEFAULT_COLORS","report","options","results","length","map","result","formatInput","formatResult","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":";;;;;kBAKwBA,M;;AALxB;;;;;;AAEA,MAAMC,gBAAgB,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAtB;AACA,MAAMC,iBAAiB,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAAvB;;AAEe,SAASF,MAAT,CAAgBG,SAAS,EAAzB,EAA6BC,UAAU,EAAvC,EAA2C;AAAA,uBAClCD,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CAAcR,MAAd,GAAuB,CAA3B,EAA8B;AAC7B,SAAO,GAAP;AACA;AACD,QAAOE,OAAOiB,QAAP,CAAgBnB,MAAhB,GAAyB,GAAzB,GAA+B,GAAtC;AACA;;AAED,SAAS2B,WAAT,CAAqBzB,MAArB,EAA6B;AAC5B,KAAIA,OAAOM,MAAP,CAAcR,MAAd,GAAuB,CAA3B,EAA8B;AAC7B,SAAO,KAAP;AACA;AACD,QAAOE,OAAOiB,QAAP,CAAgBnB,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\nexport default function 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,mCAAiC;AAAzB,8BAAA,SAAO,EAAA;AACf,8BAAyB"}
package/package.json CHANGED
@@ -1,38 +1,15 @@
1
1
  {
2
2
  "name": "@commitlint/format",
3
- "version": "7.5.0",
3
+ "version": "8.1.0",
4
4
  "description": "Format commitlint reports",
5
5
  "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
6
7
  "files": [
7
8
  "lib/"
8
9
  ],
9
10
  "scripts": {
10
- "build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps",
11
- "clean": "npx rimraf lib",
12
11
  "deps": "dep-check",
13
- "pkg": "pkg-check --skip-import",
14
- "start": "concurrently \"ava -c 4 --verbose --watch\" \"yarn run watch\"",
15
- "test": "ava -c 4 --verbose",
16
- "watch": "babel src --out-dir lib --watch --source-maps"
17
- },
18
- "ava": {
19
- "files": [
20
- "src/**/*.test.js",
21
- "!lib/**/*"
22
- ],
23
- "source": [
24
- "src/**/*.js",
25
- "!lib/**/*"
26
- ],
27
- "babel": "inherit",
28
- "require": [
29
- "babel-register"
30
- ]
31
- },
32
- "babel": {
33
- "presets": [
34
- "babel-preset-commitlint"
35
- ]
12
+ "pkg": "pkg-check --skip-import"
36
13
  },
37
14
  "engines": {
38
15
  "node": ">=4"
@@ -57,19 +34,13 @@
57
34
  },
58
35
  "license": "MIT",
59
36
  "devDependencies": {
60
- "@commitlint/test": "^7.5.0",
61
- "@commitlint/utils": "^7.5.0",
62
- "ava": "0.22.0",
63
- "babel-cli": "6.26.0",
64
- "babel-preset-commitlint": "^7.5.0",
65
- "babel-register": "6.26.0",
66
- "concurrently": "3.5.1",
67
- "cross-env": "5.1.1",
68
- "lodash": "4.17.11",
69
- "rimraf": "2.6.1"
37
+ "@commitlint/utils": "^8.1.0",
38
+ "@types/lodash": "4.14.134",
39
+ "lodash": "4.17.14",
40
+ "typescript": "3.5.2"
70
41
  },
71
42
  "dependencies": {
72
- "babel-runtime": "^6.23.0",
73
43
  "chalk": "^2.0.1"
74
- }
44
+ },
45
+ "gitHead": "c17420d67adafdf37f68d6861d29a0e85a4a3bd7"
75
46
  }
package/lib/index.test.js DELETED
@@ -1,124 +0,0 @@
1
- 'use strict';
2
-
3
- var _ava = require('ava');
4
-
5
- var _ava2 = _interopRequireDefault(_ava);
6
-
7
- var _chalk = require('chalk');
8
-
9
- var _chalk2 = _interopRequireDefault(_chalk);
10
-
11
- var _lodash = require('lodash');
12
-
13
- var _ = require('.');
14
-
15
- var _2 = _interopRequireDefault(_);
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
-
19
- 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`);
20
-
21
- (0, _ava2.default)('does nothing without arguments', t => {
22
- const actual = (0, _2.default)();
23
- t.deepEqual(actual, ok);
24
- });
25
-
26
- (0, _ava2.default)('does nothing without report results', t => {
27
- const actual = (0, _2.default)({ results: [] });
28
- t.deepEqual(actual, ok);
29
- });
30
-
31
- (0, _ava2.default)('does nothing without .errors and .warnings', t => {
32
- const actual = (0, _2.default)({ results: [{}] });
33
- t.deepEqual(actual, ok);
34
- });
35
-
36
- (0, _ava2.default)('returns empty summary of problems for empty .errors and .warnings', t => {
37
- const actual = (0, _2.default)({
38
- results: [{
39
- errors: [],
40
- warnings: []
41
- }]
42
- });
43
-
44
- t.true(actual.includes('0 problems, 0 warnings'));
45
- });
46
-
47
- (0, _ava2.default)('returns a correct of empty .errors and .warnings', t => {
48
- const actualError = (0, _2.default)({
49
- results: [{
50
- errors: [{
51
- level: 2,
52
- name: 'error-name',
53
- message: 'There was an error'
54
- }]
55
- }]
56
- });
57
-
58
- const actualWarning = (0, _2.default)({
59
- results: [{
60
- warnings: [{
61
- level: 1,
62
- name: 'warning-name',
63
- message: 'There was a problem'
64
- }]
65
- }]
66
- });
67
-
68
- t.true((0, _lodash.includes)(actualError, 'There was an error'));
69
- t.true((0, _lodash.includes)(actualError, '1 problems, 0 warnings'));
70
- t.true((0, _lodash.includes)(actualWarning, 'There was a problem'));
71
- t.true((0, _lodash.includes)(actualWarning, '0 problems, 1 warnings'));
72
- });
73
-
74
- (0, _ava2.default)('uses appropriate signs by default', t => {
75
- const actualError = (0, _2.default)({
76
- results: [{
77
- errors: [{
78
- level: 2,
79
- name: 'error-name',
80
- message: 'There was an error'
81
- }]
82
- }]
83
- });
84
-
85
- const actualWarning = (0, _2.default)({
86
- results: [{
87
- warnings: [{
88
- level: 1,
89
- name: 'warning-name',
90
- message: 'There was a problem'
91
- }]
92
- }]
93
- });
94
-
95
- t.true((0, _lodash.includes)(actualError, '✖'));
96
- t.true((0, _lodash.includes)(actualWarning, '⚠'));
97
- });
98
-
99
- (0, _ava2.default)('uses signs as configured', t => {
100
- const options = { signs: ['HNT', 'WRN', 'ERR'] };
101
- const actualError = (0, _2.default)({
102
- results: [{
103
- errors: [{
104
- level: 2,
105
- name: 'error-name',
106
- message: 'There was an error'
107
- }]
108
- }]
109
- }, options);
110
-
111
- const actualWarning = (0, _2.default)({
112
- results: [{
113
- warnings: [{
114
- level: 1,
115
- name: 'warning-name',
116
- message: 'There was a problem'
117
- }]
118
- }]
119
- }, options);
120
-
121
- t.true((0, _lodash.includes)(actualError, 'ERR'));
122
- t.true((0, _lodash.includes)(actualWarning, 'WRN'));
123
- });
124
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"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"],"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,EAAoBJ,EAApB;AACA,CAHD;;AAKA,mBAAK,qCAAL,EAA4CG,KAAK;AAChD,OAAMC,SAAS,gBAAO,EAACE,SAAS,EAAV,EAAP,CAAf;AACAH,GAAEE,SAAF,CAAYD,MAAZ,EAAoBJ,EAApB;AACA,CAHD;;AAKA,mBAAK,4CAAL,EAAmDG,KAAK;AACvD,OAAMC,SAAS,gBAAO,EAACE,SAAS,CAAC,EAAD,CAAV,EAAP,CAAf;AACAH,GAAEE,SAAF,CAAYD,MAAZ,EAAoBJ,EAApB;AACA,CAHD;;AAKA,mBAAK,mEAAL,EAA0EG,KAAK;AAC9E,OAAMC,SAAS,gBAAO;AACrBE,WAAS,CACR;AACCC,WAAQ,EADT;AAECC,aAAU;AAFX,GADQ;AADY,EAAP,CAAf;;AASAL,GAAEM,IAAF,CAAOL,OAAOM,QAAP,CAAgB,wBAAhB,CAAP;AACA,CAXD;;AAaA,mBAAK,kDAAL,EAAyDP,KAAK;AAC7D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CADR;AAECC,UAAM,YAFP;AAGCC,aAAS;AAHV,IADO;AADT,GADQ;AADV,EADmB,EAcnBE,OAdmB,CAApB;;AAiBA,OAAMD,gBAAgB,gBACrB;AACCT,WAAS,CACR;AACCE,aAAU,CACT;AACCI,WAAO,CADR;AAECC,UAAM,cAFP;AAGCC,aAAS;AAHV,IADS;AADX,GADQ;AADV,EADqB,EAcrBE,OAdqB,CAAtB;;AAiBAb,GAAEM,IAAF,CAAO,sBAASE,WAAT,EAAsB,KAAtB,CAAP;AACAR,GAAEM,IAAF,CAAO,sBAASM,aAAT,EAAwB,KAAxB,CAAP;AACA,CAtCD","file":"index.test.js","sourcesContent":["import test from 'ava';\nimport chalk from 'chalk';\nimport {includes} from 'lodash';\nimport format 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"]}