@@ -90,8 +90,10 @@ describe('Start-url gatherer', () => {
9090 startUrlGathererWithQueryString . pass ( optionsWithQueryString )
9191 . then ( _ => startUrlGathererWithQueryString . afterPass ( optionsWithQueryString , tracingData ) )
9292 ] ) . then ( ( [ artifact , artifactWithQueryString ] ) => {
93- assert . strictEqual ( artifact , - 1 ) ;
94- assert . strictEqual ( artifactWithQueryString , - 1 ) ;
93+ assert . equal ( artifact . statusCode , - 1 ) ;
94+ assert . ok ( artifact . debugString , 'did not set debug string' ) ;
95+ assert . equal ( artifactWithQueryString . statusCode , - 1 ) ;
96+ assert . ok ( artifactWithQueryString . debugString , 'did not set debug string' ) ;
9597 } ) ;
9698 } ) ;
9799
@@ -113,25 +115,22 @@ describe('Start-url gatherer', () => {
113115 startUrlGathererWithFragment . pass ( optionsWithQueryString )
114116 . then ( _ => startUrlGathererWithFragment . afterPass ( optionsWithQueryString , tracingData ) )
115117 ] ) . then ( ( [ artifact , artifactWithFragment ] ) => {
116- assert . strictEqual ( artifact , 200 ) ;
117- assert . strictEqual ( artifactWithFragment , 200 ) ;
118+ assert . equal ( artifact . statusCode , 200 ) ;
119+ assert . equal ( artifactWithFragment . statusCode , 200 ) ;
118120 } ) ;
119121 } ) ;
120122
121- it ( 'returns an error when manifest cannot be found' , ( ) => {
123+ it ( 'returns a debugString when manifest cannot be found' , ( ) => {
122124 const startUrlGatherer = new StartUrlGatherer ( ) ;
123125 const options = {
124126 url : 'https://ifixit-pwa.appspot.com/' ,
125127 driver : wrapSendCommand ( mockDriver , '' )
126128 } ;
127129
128- startUrlGatherer . pass ( options )
130+ return startUrlGatherer . pass ( options )
129131 . then ( _ => startUrlGatherer . afterPass ( options , tracingData ) )
130- . then ( _ => {
131- assert . ok ( false , 'should fail because manifest is empty' ) ;
132- } )
133- . catch ( err => {
134- assert . strictEqual ( err . message , `No web app manifest found on page ${ options . url } ` ) ;
132+ . then ( artifact => {
133+ assert . equal ( artifact . debugString , 'ERROR: start_url string empty' ) ;
135134 } ) ;
136135 } ) ;
137136
@@ -142,13 +141,10 @@ describe('Start-url gatherer', () => {
142141 driver : wrapSendCommand ( mockDriver , 'https://not-same-origin.com/' )
143142 } ;
144143
145- startUrlGatherer . pass ( options )
144+ return startUrlGatherer . pass ( options )
146145 . then ( _ => startUrlGatherer . afterPass ( options , tracingData ) )
147- . then ( _ => {
148- assert . ok ( false , 'should fail because origin is not the same' ) ;
149- } )
150- . catch ( err => {
151- assert . strictEqual ( err . message , 'ERROR: start_url must be same-origin as document' ) ;
146+ . then ( artifact => {
147+ assert . equal ( artifact . debugString , 'ERROR: start_url must be same-origin as document' ) ;
152148 } ) ;
153149 } ) ;
154150} ) ;
0 commit comments