core-validate-commit
Advanced tools
Comparing version 3.5.1 to 3.6.0
{ | ||
"name": "core-validate-commit", | ||
"version": "3.5.1", | ||
"version": "3.6.0", | ||
"description": "Validate the commit message for a particular commit in node core", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"pretest": "lintit && check-pkg", | ||
"test": "tap -j4 --cov test/**/*.js", | ||
"test": "tap -j4 --cov test/**/*.js test/*.js", | ||
"posttest": "tap --coverage-report=text-summary" | ||
@@ -11,0 +11,0 @@ }, |
@@ -109,2 +109,23 @@ 'use strict' | ||
const str7 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99 | ||
Author: Wyatt Preul <wpreul@gmail.com> | ||
Date: Thu Mar 3 10:10:46 2016 -0600 | ||
test: check memoryUsage properties. | ||
` | ||
const str8 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99 | ||
Author: Wyatt Preul <wpreul@gmail.com> | ||
Date: Thu Mar 3 10:10:46 2016 -0600 | ||
test: Check memoryUsage properties | ||
` | ||
const str9 = `commit 7d3a7ea0d7df9b6f11df723dec370f49f4f87e99 | ||
Author: Wyatt Preul <wpreul@gmail.com> | ||
Date: Thu Mar 3 10:10:46 2016 -0600 | ||
test: Check memoryUsage properties. | ||
` | ||
test('Validator - misc', (t) => { | ||
@@ -275,3 +296,55 @@ const v = new Validator() | ||
t.test('trailing punctuation in title line', (tt) => { | ||
const v = new Validator({ | ||
'validate-metadata': false | ||
}) | ||
v.lint(str7) | ||
v.on('commit', (data) => { | ||
const msgs = data.messages | ||
const filtered = msgs.filter((item) => { | ||
return item.level === 'fail' | ||
}) | ||
tt.equal(filtered.length, 1, 'messages.length') | ||
tt.equal(filtered[0].message, | ||
'Do not use punctuation at end of title.', | ||
'message') | ||
tt.end() | ||
}) | ||
}) | ||
t.test('first word is lowercase in title line', (tt) => { | ||
const v = new Validator({ | ||
'validate-metadata': false | ||
}) | ||
v.lint(str8) | ||
v.on('commit', (data) => { | ||
const msgs = data.messages | ||
const filtered = msgs.filter((item) => { | ||
return item.level === 'fail' | ||
}) | ||
tt.equal(filtered.length, 1, 'messages.length') | ||
tt.equal(filtered[0].message, | ||
'First word after subsystem(s) in title should be lowercase.', | ||
'message') | ||
tt.equal(filtered[0].column, 7, 'column') | ||
tt.end() | ||
}) | ||
}) | ||
t.test('more than one formatting error in title line', (tt) => { | ||
const v = new Validator({ | ||
'validate-metadata': false | ||
}) | ||
v.lint(str9) | ||
v.on('commit', (data) => { | ||
const msgs = data.messages | ||
const filtered = msgs.filter((item) => { | ||
return item.level === 'fail' | ||
}) | ||
tt.equal(filtered.length, 2, 'messages.length') | ||
tt.end() | ||
}) | ||
}) | ||
t.end() | ||
}) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
50291
30
1620
3