@@ -2,7 +2,7 @@ const t = require('tap')
22const requireInject = require ( 'require-inject' )
33const npm = { }
44const { explainNode, printNode } = requireInject ( '../../../lib/utils/explain-dep.js' , {
5- '../../../lib/npm.js' : npm
5+ '../../../lib/npm.js' : npm ,
66} )
77
88const cases = {
@@ -16,10 +16,10 @@ const cases = {
1616 name : 'prod-dep' ,
1717 spec : '1.x' ,
1818 from : {
19- location : '/path/to/project'
20- }
21- }
22- ]
19+ location : '/path/to/project' ,
20+ } ,
21+ } ,
22+ ] ,
2323 } ,
2424
2525 deepDev : {
@@ -51,16 +51,16 @@ const cases = {
5151 name : 'topdev' ,
5252 spec : '4.x' ,
5353 from : {
54- location : '/path/to/project'
55- }
56- }
57- ]
58- }
59- }
60- ]
61- }
62- }
63- ]
54+ location : '/path/to/project' ,
55+ } ,
56+ } ,
57+ ] ,
58+ } ,
59+ } ,
60+ ] ,
61+ } ,
62+ } ,
63+ ] ,
6464 } ,
6565
6666 optional : {
@@ -74,10 +74,10 @@ const cases = {
7474 name : 'optdep' ,
7575 spec : '1.0.0' ,
7676 from : {
77- location : '/path/to/project'
78- }
79- }
80- ]
77+ location : '/path/to/project' ,
78+ } ,
79+ } ,
80+ ] ,
8181 } ,
8282
8383 peer : {
@@ -91,19 +91,19 @@ const cases = {
9191 name : 'peer' ,
9292 spec : '1.0.0' ,
9393 from : {
94- location : '/path/to/project'
95- }
96- }
97- ]
94+ location : '/path/to/project' ,
95+ } ,
96+ } ,
97+ ] ,
9898 } ,
9999
100100 extraneous : {
101101 name : 'extra-neos' ,
102102 version : '1337.420.69-lol' ,
103103 location : 'node_modules/extra-neos' ,
104104 dependents : [ ] ,
105- extraneous : true
106- }
105+ extraneous : true ,
106+ } ,
107107}
108108
109109cases . manyDeps = {
@@ -114,31 +114,39 @@ cases.manyDeps = {
114114 type : 'prod' ,
115115 name : 'manydep' ,
116116 spec : '1.0.0' ,
117- from : cases . prodDep
117+ from : cases . prodDep ,
118118 } ,
119119 {
120120 type : 'optional' ,
121121 name : 'manydep' ,
122122 spec : '1.x' ,
123- from : cases . optional
123+ from : cases . optional ,
124124 } ,
125125 {
126126 type : 'prod' ,
127127 name : 'manydep' ,
128128 spec : '1.0.x' ,
129- from : cases . extraneous
129+ from : cases . extraneous ,
130130 } ,
131131 {
132132 type : 'dev' ,
133133 name : 'manydep' ,
134134 spec : '*' ,
135- from : cases . deepDev
135+ from : cases . deepDev ,
136136 } ,
137137 {
138138 type : 'peer' ,
139139 name : 'manydep' ,
140140 spec : '>1.0.0-beta <1.0.1' ,
141- from : cases . peer
141+ from : cases . peer ,
142+ } ,
143+ {
144+ type : 'prod' ,
145+ name : 'manydep' ,
146+ spec :'>1.0.0-beta <1.0.1' ,
147+ from : {
148+ location : '/path/to/project' ,
149+ } ,
142150 } ,
143151 {
144152 type : 'prod' ,
@@ -148,9 +156,9 @@ cases.manyDeps = {
148156 name : 'a package with a pretty long name' ,
149157 version : '1.2.3' ,
150158 dependents : {
151- location : '/path/to/project'
152- }
153- }
159+ location : '/path/to/project' ,
160+ } ,
161+ } ,
154162 } ,
155163 {
156164 type : 'prod' ,
@@ -160,9 +168,9 @@ cases.manyDeps = {
160168 name : 'another package with a pretty long name' ,
161169 version : '1.2.3' ,
162170 dependents : {
163- location : '/path/to/project'
164- }
165- }
171+ location : '/path/to/project' ,
172+ } ,
173+ } ,
166174 } ,
167175 {
168176 type : 'prod' ,
@@ -172,14 +180,13 @@ cases.manyDeps = {
172180 name : 'yet another a package with a pretty long name' ,
173181 version : '1.2.3' ,
174182 dependents : {
175- location : '/path/to/project'
176- }
177- }
183+ location : '/path/to/project' ,
184+ } ,
185+ } ,
178186 } ,
179- ]
187+ ] ,
180188}
181189
182-
183190for ( const [ name , expl ] of Object . entries ( cases ) ) {
184191 t . test ( name , t => {
185192 npm . color = true
0 commit comments