@@ -214,7 +214,7 @@ describe('WebApplicationsSourceAdapter', () => {
214214 ) ;
215215 } ;
216216
217- it ( 'should throw on malformed JSON' , ( ) => {
217+ it ( 'should throw on malformed JSON with full error detail ' , ( ) => {
218218 const vfs : VirtualDirectory [ ] = [
219219 {
220220 dirPath : APP_PATH ,
@@ -230,7 +230,11 @@ describe('WebApplicationsSourceAdapter', () => {
230230 forceIgnore ,
231231 new VirtualTreeContainer ( vfs )
232232 ) ;
233- assert . throws ( ( ) => a . getComponent ( APP_PATH ) , SfError , 'Invalid JSON in webapplication.json' ) ;
233+ assert . throws (
234+ ( ) => a . getComponent ( APP_PATH ) ,
235+ SfError ,
236+ / ^ I n v a l i d J S O N i n w e b a p p l i c a t i o n \. j s o n : .+ /
237+ ) ;
234238 } ) ;
235239
236240 it ( 'should throw when outputDir is missing' , ( ) => {
@@ -306,13 +310,11 @@ describe('WebApplicationsSourceAdapter', () => {
306310 const a = adapterWith ( config , [
307311 { dirPath : DIST_PATH , children : [ { name : 'index.html' , data : Buffer . from ( '<html>test</html>' ) } ] } ,
308312 ] ) ;
313+ const expectedPath = join ( DIST_PATH , 'missing-rewrite.html' ) ;
309314 assert . throws (
310315 ( ) => a . getComponent ( APP_PATH ) ,
311316 SfError ,
312- messages . getMessage ( 'error_expected_source_files' , [
313- join ( DIST_PATH , 'missing-rewrite.html' ) ,
314- registry . types . webapplication . name ,
315- ] )
317+ `A rewrite target defined in webapplication.json -> routing.rewrites was not found: ${ expectedPath } . Ensure the file exists at that location.`
316318 ) ;
317319 } ) ;
318320
@@ -414,13 +416,11 @@ describe('WebApplicationsSourceAdapter', () => {
414416 ] ,
415417 } ;
416418 const a = adapterWith ( config , [ distDir ] ) ;
419+ const expectedPath = join ( DIST_PATH , 'missing-docs.html' ) ;
417420 assert . throws (
418421 ( ) => a . getComponent ( APP_PATH ) ,
419422 SfError ,
420- messages . getMessage ( 'error_expected_source_files' , [
421- join ( DIST_PATH , 'missing-docs.html' ) ,
422- registry . types . webapplication . name ,
423- ] )
423+ `A rewrite target defined in webapplication.json -> routing.rewrites was not found: ${ expectedPath } . Ensure the file exists at that location.`
424424 ) ;
425425 } ) ;
426426 } ) ;
0 commit comments