@@ -50,8 +50,22 @@ describe('FastbootConfig', function() {
5050
5151 await output . build ( ) ;
5252
53- expect ( output . read ( ) ) . to . deep . equal ( {
54- 'package.json' : `{"dependencies":{},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":[],"schemaVersion":3}}` ,
53+ let files = output . read ( ) ;
54+
55+ expect ( files ) . to . have . key ( 'package.json' ) ;
56+ expect ( JSON . parse ( files [ 'package.json' ] ) ) . to . deep . equal ( {
57+ dependencies : { } ,
58+ fastboot : {
59+ appName : 'app' ,
60+ config : { app : { modulePrefix : 'app' } } ,
61+ manifest : {
62+ appFiles : [ 'app.js' , 'app-fastboot.js' ] ,
63+ htmlFile : 'index.html' ,
64+ vendorFiles : [ 'vendor.js' ] ,
65+ } ,
66+ moduleWhitelist : [ ] ,
67+ schemaVersion : 3 ,
68+ } ,
5569 } ) ;
5670
5771 await output . build ( ) ;
@@ -72,8 +86,22 @@ describe('FastbootConfig', function() {
7286 'package.json' : 'change' ,
7387 } ) ;
7488
75- expect ( output . read ( ) ) . to . deep . equal ( {
76- 'package.json' : `{"dependencies":{"apple":"*","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}` ,
89+ let changedFiles = output . read ( ) ;
90+
91+ expect ( changedFiles ) . to . have . key ( 'package.json' ) ;
92+ expect ( JSON . parse ( changedFiles [ 'package.json' ] ) ) . to . deep . equal ( {
93+ dependencies : { apple : '*' , orange : '^1.0.0' } ,
94+ fastboot : {
95+ appName : 'app' ,
96+ config : { app : { modulePrefix : 'app' } } ,
97+ manifest : {
98+ appFiles : [ 'app.js' , 'app-fastboot.js' ] ,
99+ htmlFile : 'index.html' ,
100+ vendorFiles : [ 'vendor.js' ] ,
101+ } ,
102+ moduleWhitelist : [ 'apple' , 'orange' ] ,
103+ schemaVersion : 3 ,
104+ } ,
77105 } ) ;
78106
79107 project . pkg . fastbootDependencies = [ 'apple' , 'orange' ] ;
@@ -88,8 +116,22 @@ describe('FastbootConfig', function() {
88116
89117 await output . build ( ) ;
90118
91- expect ( output . read ( ) ) . to . deep . equal ( {
92- 'package.json' : `{"dependencies":{"apple":"^3.0.0","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}` ,
119+ let moreChangedFiles = output . read ( ) ;
120+
121+ expect ( moreChangedFiles ) . to . have . key ( 'package.json' ) ;
122+ expect ( JSON . parse ( moreChangedFiles [ 'package.json' ] ) ) . to . deep . equal ( {
123+ dependencies : { apple : '^3.0.0' , orange : '^1.0.0' } ,
124+ fastboot : {
125+ appName : 'app' ,
126+ config : { app : { modulePrefix : 'app' } } ,
127+ manifest : {
128+ appFiles : [ 'app.js' , 'app-fastboot.js' ] ,
129+ htmlFile : 'index.html' ,
130+ vendorFiles : [ 'vendor.js' ] ,
131+ } ,
132+ moduleWhitelist : [ 'apple' , 'orange' ] ,
133+ schemaVersion : 3 ,
134+ } ,
93135 } ) ;
94136 } ) ;
95137} ) ;
0 commit comments