@@ -13,12 +13,53 @@ describe('Deps', () => {
1313
1414 describe ( 'resolve' , ( ) => {
1515
16- it ( 'returns flattened list of deps' , async ( ) => {
16+ it ( 'returns flattened list of direct prod deps' , async ( ) => {
1717
1818 const result = await Deps . resolve ( {
19- packageJson : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test-package.json' ) ) ) ,
20- lockfile : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test-lock.json' ) ) )
19+ packageJson : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'package.json' ) ) ) ,
20+ lockfile : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'npm-shrinkwrap.json' ) ) )
21+ } , { } ) ;
22+
23+ expect ( result ) . to . equal ( {
24+ 'ci-info' : [ '1.6.0' ] ,
25+ 'is-ci' : [ '2.0.0' ]
26+ } ) ;
27+ } ) ;
28+
29+ it ( 'returns flattened list of all deps' , async ( ) => {
30+
31+ const result = await Deps . resolve ( {
32+ packageJson : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'package.json' ) ) ) ,
33+ lockfile : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'npm-shrinkwrap.json' ) ) )
34+ } , { deep : true , dev : true } ) ;
35+
36+ expect ( result ) . to . equal ( {
37+ 'ci-info' : [ '1.6.0' , '2.0.0' ] ,
38+ 'is-ci' : [ '2.0.0' ] ,
39+ 'ms' : [ '2.1.2' ]
2140 } ) ;
41+ } ) ;
42+
43+ it ( 'returns flattened list of deps (only direct)' , async ( ) => {
44+
45+ const result = await Deps . resolve ( {
46+ packageJson : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'package.json' ) ) ) ,
47+ lockfile : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'npm-shrinkwrap.json' ) ) )
48+ } , { dev : true } ) ;
49+
50+ expect ( result ) . to . equal ( {
51+ 'ci-info' : [ '1.6.0' ] ,
52+ 'is-ci' : [ '2.0.0' ] ,
53+ 'ms' : [ '2.1.2' ]
54+ } ) ;
55+ } ) ;
56+
57+ it ( 'returns flattened list of deps (only prod)' , async ( ) => {
58+
59+ const result = await Deps . resolve ( {
60+ packageJson : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'package.json' ) ) ) ,
61+ lockfile : JSON . parse ( Fs . readFileSync ( Path . join ( __dirname , 'fixtures' , 'deps-test' , 'npm-shrinkwrap.json' ) ) )
62+ } , { deep : true } ) ;
2263
2364 expect ( result ) . to . equal ( {
2465 'ci-info' : [ '1.6.0' , '2.0.0' ] ,
0 commit comments