Skip to content

Commit

Permalink
chore: add new tests to reach full test coverage (#68)
Browse files Browse the repository at this point in the history
(and remove a duplicate test)
  • Loading branch information
janbritz authored Feb 10, 2023
1 parent 3023431 commit 320e5dd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ test('validate-npm-package-name', function (t) {

// Invalid

t.same(validate(''), {
t.same(validate(null), {
validForNewPackages: false,
validForOldPackages: false,
errors: ['name length must be greater than zero'] })
errors: ['name cannot be null'] })

t.same(validate(undefined), {
validForNewPackages: false,
validForOldPackages: false,
errors: ['name cannot be undefined'] })

t.same(validate(42), {
validForNewPackages: false,
validForOldPackages: false,
errors: ['name must be a string'] })

t.same(validate(''), {
validForNewPackages: false,
Expand Down

0 comments on commit 320e5dd

Please sign in to comment.