@@ -9,7 +9,6 @@ describe('install', () => {
99 let mod , deps , buildInfo , installedElement , npm , dirs ;
1010
1111 beforeEach ( ( ) => {
12-
1312 dirs = {
1413 root : 'root' ,
1514 configure : 'configure' ,
@@ -18,7 +17,7 @@ describe('install', () => {
1817
1918 npm = {
2019 installIfNeeded : stub ( ) . returns ( Promise . resolve ( [ ] ) )
21- }
20+ } ;
2221
2322 deps = {
2423 'fs-extra' : {
@@ -34,60 +33,61 @@ describe('install', () => {
3433
3534 installedElement = {
3635 input : { }
37- }
36+ } ;
3837
39- buildInfo = [ {
40- element : {
41- tag : 'my-el' ,
42- moduleId : '@scope/my-el'
43- } ,
44- controller : {
45- moduleId : 'my-el-controller'
46- } ,
47- configure : {
48- moduleId : '@scope/my-el-configure' ,
49- tag : 'my-el-configure'
38+ buildInfo = [
39+ {
40+ element : {
41+ tag : 'my-el' ,
42+ moduleId : '@scope/my-el'
43+ } ,
44+ controller : {
45+ moduleId : 'my-el-controller'
46+ } ,
47+ configure : {
48+ moduleId : '@scope/my-el-configure' ,
49+ tag : 'my-el-configure'
50+ }
5051 }
51- } ]
52+ ] ;
5253 mod = proxyquire ( '../../../lib/install' , deps ) ;
5354 } ) ;
5455
5556 describe ( 'controllerTargets' , ( ) => {
56-
5757 it ( 'returns a controller target' , ( ) => {
58-
5958 const out = mod . controllerTargets ( buildInfo ) ;
6059
61- expect ( out ) . to . eql ( [ {
62- pie : buildInfo [ 0 ] . element . tag ,
63- target : buildInfo [ 0 ] . controller . moduleId
64- } ] ) ;
60+ expect ( out ) . to . eql ( [
61+ {
62+ pie : buildInfo [ 0 ] . element . tag ,
63+ target : buildInfo [ 0 ] . controller . moduleId
64+ }
65+ ] ) ;
6566 } ) ;
6667 } ) ;
6768
6869 describe ( 'pieToConfigureMap' , ( ) => {
69-
7070 it ( 'returns a configure map' , ( ) => {
7171 const out = mod . pieToConfigureMap ( buildInfo ) ;
7272 expect ( out ) . to . eql ( { 'my-el' : 'my-el-configure' } ) ;
7373 } ) ;
7474 } ) ;
7575
7676 describe ( 'toDeclarations' , ( ) => {
77-
7877 it ( 'creates declarations' , ( ) => {
7978 const out = mod . toDeclarations ( buildInfo ) ;
80- const decl = new ElementDeclaration ( buildInfo [ 0 ] . element . tag , buildInfo [ 0 ] . element . moduleId ) ;
79+ const decl = new ElementDeclaration (
80+ buildInfo [ 0 ] . element . tag ,
81+ buildInfo [ 0 ] . element . moduleId
82+ ) ;
8183
8284 expect ( out ) . to . eql ( [ decl ] ) ;
8385 } ) ;
8486 } ) ;
8587
86-
8788 describe ( 'Install' , ( ) => {
88- let install , config
89+ let install , config ;
8990 beforeEach ( ( ) => {
90-
9191 config = { } ;
9292 install = new mod . default ( 'dir' , config ) ;
9393 } ) ;
@@ -100,22 +100,22 @@ describe('install', () => {
100100 let result ;
101101
102102 beforeEach ( ( ) => {
103-
104103 deps [ '@pie-cli-libs/installer' ] . install = stub ( ) . returns (
105- Promise . resolve ( { dirs, pkgs : [ installedElement ] } )
104+ Promise . resolve ( {
105+ dirs,
106+ pkgs : [ installedElement ] ,
107+ lockFiles : { root : { } }
108+ } )
106109 ) ;
107110
108- return install . install ( false )
109- . then ( r => {
110- result = r
111- } ) ;
111+ return install . install ( false ) . then ( r => {
112+ result = r ;
113+ } ) ;
112114 } ) ;
113115
114-
115116 it ( 'returns buildInfo' , ( ) => {
116117 expect ( result . pkgs [ 0 ] ) . to . eql ( installedElement ) ;
117118 } ) ;
118119 } ) ;
119-
120120 } ) ;
121- } ) ;
121+ } ) ;
0 commit comments