You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add jest unit tests, prettier w/ config and .editorconfig
jest unit tests are implemented in engine.test.js and have achieve 100% code coverage and all tests
are passing. also add prettier and .editorconfig and reformatted files
@@ -59,7 +61,13 @@ module.exports = function (options) {
59
61
// By default, we'll de-indent your commit
60
62
// template and will keep empty lines.
61
63
prompter: function(cz,commit){
62
-
console.log('\nLine 1 will have the maximum length of '+options.maxHeaderWidth+' characters (enforced). All other lines will be wrapped after '+options.maxLineWidth+' characters.\n');
64
+
console.log(
65
+
'\nLine 1 will have the maximum length of '+
66
+
options.maxHeaderWidth+
67
+
' characters (enforced). All other lines will be wrapped after '+
68
+
options.maxLineWidth+
69
+
' characters.\n'
70
+
);
63
71
64
72
// Let's ask some questions of the user
65
73
// so that we can populate our commit
@@ -72,61 +80,83 @@ module.exports = function (options) {
72
80
{
73
81
type: 'list',
74
82
name: 'type',
75
-
message: 'Select the type of change that you\'re committing:',
83
+
message: "Select the type of change that you're committing:",
76
84
choices: choices,
77
85
default: options.defaultType
78
-
},{
86
+
},
87
+
{
79
88
type: 'input',
80
89
name: 'scope',
81
-
message: 'What is the scope of this change (e.g. component or file name): (press enter to skip)',
90
+
message:
91
+
'What is the scope of this change (e.g. component or file name): (press enter to skip)',
82
92
default: options.defaultScope,
83
93
filter: function(value){
84
94
returnvalue.trim().toLowerCase();
85
95
}
86
-
},{
96
+
},
97
+
{
87
98
type: 'input',
88
99
name: 'subject',
89
-
message: function(answers){
90
-
return'Write a short, imperative tense description of the change (max '+maxSummaryLength(options,answers)+' chars):\n'
100
+
message: function(answers){
101
+
return(
102
+
'Write a short, imperative tense description of the change (max '+
103
+
maxSummaryLength(options,answers)+
104
+
' chars):\n'
105
+
);
91
106
},
92
107
default: options.defaultSubject,
93
108
validate: function(subject,answers){
94
-
varfilteredSubject=filterSubject(subject)
95
-
returnfilteredSubject.length==0 ? 'Subject is required' :
'Subject length must be less than or equal to '+maxSummaryLength(options,answers)+' characters. Current length is '+filteredSubject.length+' characters.';
0 commit comments