@@ -14,100 +14,82 @@ describe('FastbootConfig', function() {
1414 let subject ;
1515 let project ;
1616
17- beforeEach ( co . wrap ( function * ( ) {
18- input = yield createTempDir ( ) ;
17+ beforeEach ( async function ( ) {
18+ input = await createTempDir ( ) ;
1919 project = {
20- addons : [ ] ,
21- pkg : { }
20+ addons : [ ] ,
21+ pkg : { } ,
2222 } ;
2323 subject = new FastbootConfig ( input . path ( ) , {
2424 project,
2525 outputPaths : {
2626 app : { js : 'app.js' } ,
27- vendor : { js : 'vendor.js' }
27+ vendor : { js : 'vendor.js' } ,
2828 } ,
2929 appConfig : {
30- modulePrefix : 'app'
31- }
30+ modulePrefix : 'app' ,
31+ } ,
3232 } ) ;
3333 output = createBuilder ( subject ) ;
34- } ) ) ;
34+ } ) ;
3535
36- afterEach ( co . wrap ( function * ( ) {
37- yield input . dispose ( ) ;
38- yield output . dispose ( ) ;
39- } ) ) ;
36+ afterEach ( async function ( ) {
37+ await input . dispose ( ) ;
38+ await output . dispose ( ) ;
39+ } ) ;
4040
41- it ( 'it builds only when information changes' , co . wrap ( function * ( ) {
41+ it ( 'it builds only when information changes' , async function ( ) {
4242 input . write ( {
4343 'index.js' : `export { A } from "./lib/a";` ,
44- ' lib' : {
44+ lib : {
4545 'a.js' : `export class A {};` ,
4646 'b.js' : `export class B {};` ,
47- 'c.js' : `export class C {};`
48- }
47+ 'c.js' : `export class C {};` ,
48+ } ,
4949 } ) ;
5050
51- yield output . build ( ) ;
51+ await output . build ( ) ;
5252
53- expect (
54- output . read ( )
55- ) . to . deep . equal ( {
56- '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+ 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}}` ,
5755 } ) ;
5856
59- yield output . build ( ) ;
57+ await output . build ( ) ;
6058
61- expect (
62- output . changes ( )
63- ) . to . deep . equal ( { } ) ;
59+ expect ( output . changes ( ) ) . to . deep . equal ( { } ) ;
6460
65- project . pkg . fastbootDependencies = [
66- 'apple' ,
67- 'orange'
68- ] ;
61+ project . pkg . fastbootDependencies = [ 'apple' , 'orange' ] ;
6962
7063 project . pkg . dependencies = {
7164 apple : '*' ,
7265 orange : '^1.0.0' ,
73- pizza : '^1.0.0'
66+ pizza : '^1.0.0' ,
7467 } ;
7568
76- yield output . build ( ) ;
69+ await output . build ( ) ;
7770
78- expect (
79- output . changes ( )
80- ) . to . deep . equal ( {
81- 'package.json' : 'change'
71+ expect ( output . changes ( ) ) . to . deep . equal ( {
72+ 'package.json' : 'change' ,
8273 } ) ;
8374
84- expect (
85- output . read ( )
86- ) . to . deep . equal ( {
87- '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}}`
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}}` ,
8877 } ) ;
8978
90- project . pkg . fastbootDependencies = [
91- 'apple' ,
92- 'orange'
93- ] ;
79+ project . pkg . fastbootDependencies = [ 'apple' , 'orange' ] ;
9480
9581 project . pkg . dependencies . pizza = '^3.0.0' ;
9682
97- yield output . build ( ) ;
83+ await output . build ( ) ;
9884
99- expect (
100- output . changes ( )
101- ) . to . deep . equal ( { } ) ;
85+ expect ( output . changes ( ) ) . to . deep . equal ( { } ) ;
10286
10387 project . pkg . dependencies . apple = '^3.0.0' ;
10488
105- yield output . build ( ) ;
89+ await output . build ( ) ;
10690
107- expect (
108- output . read ( )
109- ) . to . deep . equal ( {
110- '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}}`
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}}` ,
11193 } ) ;
112- } ) ) ;
94+ } ) ;
11395} ) ;
0 commit comments