@@ -27,6 +27,7 @@ import { join } from './utils/join';
2727
2828describe ( 'Dependency' , ( ) => {
2929 it ( 'should extract package fields' , ( ) => {
30+ const self = false ;
3031 const pkg = {
3132 name : 'foo' ,
3233 version : '1.0.0' ,
@@ -52,9 +53,10 @@ describe('Dependency', () => {
5253 ] ,
5354 } ;
5455
55- const dependency = new Dependency ( pkg ) ;
56+ const dependency = new Dependency ( pkg , self ) ;
5657
5758 expect ( dependency ) . toEqual ( {
59+ self : false ,
5860 name : 'foo' ,
5961 version : '1.0.0' ,
6062 license : 'MIT' ,
@@ -89,6 +91,7 @@ describe('Dependency', () => {
8991 } ) ;
9092
9193 it ( 'should parse author field' , ( ) => {
94+ const self = false ;
9295 const pkg = {
9396 name : 'foo' ,
9497 version : '1.0.0' ,
@@ -97,7 +100,7 @@ describe('Dependency', () => {
97100 author :
'Mickael Jeanroy <[email protected] > (https://mjeanroy.com)' , 98101 } ;
99102
100- const dependency = new Dependency ( pkg ) ;
103+ const dependency = new Dependency ( pkg , self ) ;
101104
102105 expect ( dependency . author ) . toEqual ( {
103106 name : 'Mickael Jeanroy' ,
@@ -107,6 +110,7 @@ describe('Dependency', () => {
107110 } ) ;
108111
109112 it ( 'should parse contributors field' , ( ) => {
113+ const self = false ;
110114 const pkg = {
111115 name : 'foo' ,
112116 version : '1.0.0' ,
@@ -117,7 +121,7 @@ describe('Dependency', () => {
117121 ] ,
118122 } ;
119123
120- const dependency = new Dependency ( pkg ) ;
124+ const dependency = new Dependency ( pkg , self ) ;
121125
122126 expect ( dependency . contributors . length ) . toBe ( 1 ) ;
123127 expect ( dependency . contributors [ 0 ] ) . toEqual ( {
@@ -128,6 +132,7 @@ describe('Dependency', () => {
128132 } ) ;
129133
130134 it ( 'should parse deprecated licenses field' , ( ) => {
135+ const self = false ;
131136 const pkg = {
132137 name : 'foo' ,
133138 version : '1.0.0' ,
@@ -138,20 +143,21 @@ describe('Dependency', () => {
138143 ] ,
139144 } ;
140145
141- const dependency = new Dependency ( pkg ) ;
146+ const dependency = new Dependency ( pkg , self ) ;
142147
143148 expect ( dependency . licenses ) . not . toBeDefined ( ) ;
144149 expect ( dependency . license ) . toBe ( '(MIT OR Apache 2.0)' ) ;
145150 } ) ;
146151
147152 it ( 'should format dependency with name, version, and license fields' , ( ) => {
153+ const self = false ;
148154 const pkg = {
149155 name : 'foo' ,
150156 version : '1.0.0' ,
151157 license : 'MIT' ,
152158 } ;
153159
154- const dependency = new Dependency ( pkg ) ;
160+ const dependency = new Dependency ( pkg , self ) ;
155161
156162 expect ( dependency . text ( ) ) . toEqual ( join ( [
157163 `Name: ${ pkg . name } ` ,
@@ -162,14 +168,15 @@ describe('Dependency', () => {
162168 } ) ;
163169
164170 it ( 'should format dependency with optional description fied' , ( ) => {
171+ const self = false ;
165172 const pkg = {
166173 name : 'foo' ,
167174 version : '1.0.0' ,
168175 license : 'MIT' ,
169176 description : 'Desc' ,
170177 } ;
171178
172- const dependency = new Dependency ( pkg ) ;
179+ const dependency = new Dependency ( pkg , self ) ;
173180
174181 expect ( dependency . text ( ) ) . toEqual ( join ( [
175182 `Name: ${ pkg . name } ` ,
@@ -181,6 +188,7 @@ describe('Dependency', () => {
181188 } ) ;
182189
183190 it ( 'should format dependency with optional author field' , ( ) => {
191+ const self = false ;
184192 const pkg = {
185193 name : 'foo' ,
186194 version : '1.0.0' ,
@@ -191,7 +199,7 @@ describe('Dependency', () => {
191199 } ,
192200 } ;
193201
194- const dependency = new Dependency ( pkg ) ;
202+ const dependency = new Dependency ( pkg , self ) ;
195203
196204 expect ( dependency . text ( ) ) . toEqual ( join ( [
197205 `Name: ${ pkg . name } ` ,
@@ -203,6 +211,7 @@ describe('Dependency', () => {
203211 } ) ;
204212
205213 it ( 'should format dependency with optional repository field' , ( ) => {
214+ const self = false ;
206215 const pkg = {
207216 name : 'foo' ,
208217 version : '1.0.0' ,
@@ -213,7 +222,7 @@ describe('Dependency', () => {
213222 } ,
214223 } ;
215224
216- const dependency = new Dependency ( pkg ) ;
225+ const dependency = new Dependency ( pkg , self ) ;
217226
218227 expect ( dependency . text ( ) ) . toEqual ( join ( [
219228 `Name: ${ pkg . name } ` ,
@@ -225,14 +234,15 @@ describe('Dependency', () => {
225234 } ) ;
226235
227236 it ( 'should format dependency with optional homepage field' , ( ) => {
237+ const self = false ;
228238 const pkg = {
229239 name : 'foo' ,
230240 version : '1.0.0' ,
231241 license : 'MIT' ,
232242 homepage : 'https://github.com/mjeanroy' ,
233243 } ;
234244
235- const dependency = new Dependency ( pkg ) ;
245+ const dependency = new Dependency ( pkg , self ) ;
236246
237247 expect ( dependency . text ( ) ) . toEqual ( join ( [
238248 `Name: ${ pkg . name } ` ,
@@ -244,6 +254,7 @@ describe('Dependency', () => {
244254 } ) ;
245255
246256 it ( 'should format dependency with optional contributors field' , ( ) => {
257+ const self = false ;
247258 const pkg = {
248259 name : 'foo' ,
249260 version : '1.0.0' ,
@@ -254,7 +265,7 @@ describe('Dependency', () => {
254265 ] ,
255266 } ;
256267
257- const dependency = new Dependency ( pkg ) ;
268+ const dependency = new Dependency ( pkg , self ) ;
258269
259270 expect ( dependency . text ( ) ) . toEqual ( join ( [
260271 `Name: ${ pkg . name } ` ,
@@ -268,6 +279,7 @@ describe('Dependency', () => {
268279 } ) ;
269280
270281 it ( 'should format dependency with all optional fields' , ( ) => {
282+ const self = false ;
271283 const pkg = {
272284 name : 'foo' ,
273285 version : '1.0.0' ,
@@ -282,7 +294,7 @@ describe('Dependency', () => {
282294 ] ,
283295 } ;
284296
285- const dependency = new Dependency ( pkg ) ;
297+ const dependency = new Dependency ( pkg , self ) ;
286298
287299 expect ( dependency . text ( ) ) . toEqual ( join ( [
288300 `Name: ${ pkg . name } ` ,
@@ -300,6 +312,7 @@ describe('Dependency', () => {
300312 } ) ;
301313
302314 it ( 'should format dependency with license text' , ( ) => {
315+ const self = false ;
303316 const pkg = {
304317 name : 'foo' ,
305318 version : '1.0.0' ,
@@ -326,7 +339,7 @@ describe('Dependency', () => {
326339 ] ,
327340 } ;
328341
329- const dependency = new Dependency ( pkg ) ;
342+ const dependency = new Dependency ( pkg , self ) ;
330343
331344 expect ( dependency . text ( ) ) . toEqual ( join ( [
332345 `Name: ${ pkg . name } ` ,
@@ -348,6 +361,7 @@ describe('Dependency', () => {
348361 } ) ;
349362
350363 it ( 'should format dependency with notice text' , ( ) => {
364+ const self = false ;
351365 const pkg = {
352366 name : 'foo' ,
353367 version : '1.0.0' ,
@@ -358,7 +372,7 @@ describe('Dependency', () => {
358372 homepage : 'https://github.com/mjeanroy' ,
359373 } ;
360374
361- const dependency = new Dependency ( pkg ) ;
375+ const dependency = new Dependency ( pkg , self ) ;
362376
363377 expect ( dependency . text ( ) ) . toEqual ( join ( [
364378 `Name: ${ pkg . name } ` ,
0 commit comments