Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 11, 2020
1 parent f0700d9 commit 5ae21e4
Showing 1 changed file with 40 additions and 41 deletions.
81 changes: 40 additions & 41 deletions test/lib/utils/explain-dep.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const t = require('tap')
const requireInject = require('require-inject')
const npm = {}
const { explainNode, printNode } = requireInject('../../../lib/utils/explain-dep.js', {
'../../../lib/npm.js': npm
'../../../lib/npm.js': npm,
})

const cases = {
Expand All @@ -16,10 +16,10 @@ const cases = {
name: 'prod-dep',
spec: '1.x',
from: {
location: '/path/to/project'
}
}
]
location: '/path/to/project',
},
},
],
},

deepDev: {
Expand Down Expand Up @@ -51,16 +51,16 @@ const cases = {
name: 'topdev',
spec: '4.x',
from: {
location: '/path/to/project'
}
}
]
}
}
]
}
}
]
location: '/path/to/project',
},
},
],
},
},
],
},
},
],
},

optional: {
Expand All @@ -74,10 +74,10 @@ const cases = {
name: 'optdep',
spec: '1.0.0',
from: {
location: '/path/to/project'
}
}
]
location: '/path/to/project',
},
},
],
},

peer: {
Expand All @@ -91,19 +91,19 @@ const cases = {
name: 'peer',
spec: '1.0.0',
from: {
location: '/path/to/project'
}
}
]
location: '/path/to/project',
},
},
],
},

extraneous: {
name: 'extra-neos',
version: '1337.420.69-lol',
location: 'node_modules/extra-neos',
dependents: [],
extraneous: true
}
extraneous: true,
},
}

cases.manyDeps = {
Expand All @@ -114,31 +114,31 @@ cases.manyDeps = {
type: 'prod',
name: 'manydep',
spec: '1.0.0',
from: cases.prodDep
from: cases.prodDep,
},
{
type: 'optional',
name: 'manydep',
spec: '1.x',
from: cases.optional
from: cases.optional,
},
{
type: 'prod',
name: 'manydep',
spec: '1.0.x',
from: cases.extraneous
from: cases.extraneous,
},
{
type: 'dev',
name: 'manydep',
spec: '*',
from: cases.deepDev
from: cases.deepDev,
},
{
type: 'peer',
name: 'manydep',
spec: '>1.0.0-beta <1.0.1',
from: cases.peer
from: cases.peer,
},
{
type: 'prod',
Expand All @@ -148,9 +148,9 @@ cases.manyDeps = {
name: 'a package with a pretty long name',
version: '1.2.3',
dependents: {
location: '/path/to/project'
}
}
location: '/path/to/project',
},
},
},
{
type: 'prod',
Expand All @@ -160,9 +160,9 @@ cases.manyDeps = {
name: 'another package with a pretty long name',
version: '1.2.3',
dependents: {
location: '/path/to/project'
}
}
location: '/path/to/project',
},
},
},
{
type: 'prod',
Expand All @@ -172,14 +172,13 @@ cases.manyDeps = {
name: 'yet another a package with a pretty long name',
version: '1.2.3',
dependents: {
location: '/path/to/project'
}
}
location: '/path/to/project',
},
},
},
]
],
}


for (const [name, expl] of Object.entries(cases)) {
t.test(name, t => {
npm.color = true
Expand Down

0 comments on commit 5ae21e4

Please sign in to comment.