@@ -4,7 +4,7 @@ import proxyquire from 'proxyquire';
44
55describe ( 'catalog' , ( ) => {
66
7- let mod , deps , catalog , NAMES ;
7+ let mod , deps , catalog , NAMES , support ;
88
99 beforeEach ( ( ) => {
1010
@@ -33,6 +33,13 @@ describe('catalog', () => {
3333
3434 mod = proxyquire ( '../../../../lib/apps/catalog' , deps ) ;
3535
36+ support = {
37+ externals : {
38+ js : [ 'external.js' ] ,
39+ css : [ 'external.css' ]
40+ }
41+ }
42+
3643 catalog = new mod . default ( {
3744 configuration : {
3845 app : {
@@ -42,7 +49,9 @@ describe('catalog', () => {
4249 } , 'pieRoot' , {
4350 dir : 'dir' ,
4451 declarations : [ ]
45- } , { } , {
52+ } ,
53+ support ,
54+ {
4655 build : {
4756 entryFile : '.all-in-one.entry.js'
4857 } ,
@@ -114,7 +123,8 @@ describe('catalog', () => {
114123 let init = ( exists , done ) => {
115124 archive = {
116125 file : stub ( ) ,
117- directory : stub ( )
126+ directory : stub ( ) ,
127+ append : stub ( )
118128 }
119129 deps [ 'fs-extra' ] . existsSync . returns ( exists ) ;
120130 deps [ '../create-archive' ] . createArchive = spy (
@@ -148,6 +158,10 @@ describe('catalog', () => {
148158 assert . calledWith ( archive . directory , match ( / .* d o c s \/ s c h e m a s $ / ) , 'schemas' ) ;
149159 } ) ;
150160
161+ it ( 'calls archive.append for externals.json' , ( ) => {
162+ assert . calledWith ( archive . append , JSON . stringify ( support . externals ) , { name : 'pie-pkg/externals.json' } ) ;
163+ } ) ;
164+
151165 describe ( 'when schemas does not exist' , ( ) => {
152166 beforeEach ( ( done ) => {
153167 init ( false , done ) ;
0 commit comments