@@ -449,6 +449,63 @@ describe('Protocol', function () {
449449 } ) ;
450450
451451 describe ( 'HPM-to-MockApp' , function ( ) {
452+ describe ( 'notfound' , function ( ) {
453+ it ( 'GET request to uknown url returns 404 Not Found' , function ( done ) {
454+ iframeLoaded
455+ . then ( ( ) => {
456+ hpm . get < any > ( 'route/that/does/not/exist' )
457+ . catch ( response => {
458+ expect ( response . statusCode ) . toEqual ( 404 ) ;
459+ done ( ) ;
460+ } ) ;
461+ } ) ;
462+ } ) ;
463+
464+ it ( 'POST request to uknown url returns 404 Not Found' , function ( done ) {
465+ iframeLoaded
466+ . then ( ( ) => {
467+ hpm . post < any > ( 'route/that/does/not/exist' , null )
468+ . catch ( response => {
469+ expect ( response . statusCode ) . toEqual ( 404 ) ;
470+ done ( ) ;
471+ } ) ;
472+ } ) ;
473+ } ) ;
474+
475+ it ( 'PUT request to uknown url returns 404 Not Found' , function ( done ) {
476+ iframeLoaded
477+ . then ( ( ) => {
478+ hpm . put < any > ( 'route/that/does/not/exist' , null )
479+ . catch ( response => {
480+ expect ( response . statusCode ) . toEqual ( 404 ) ;
481+ done ( ) ;
482+ } ) ;
483+ } ) ;
484+ } ) ;
485+
486+ it ( 'PATCH request to uknown url returns 404 Not Found' , function ( done ) {
487+ iframeLoaded
488+ . then ( ( ) => {
489+ hpm . patch < any > ( 'route/that/does/not/exist' , null )
490+ . catch ( response => {
491+ expect ( response . statusCode ) . toEqual ( 404 ) ;
492+ done ( ) ;
493+ } ) ;
494+ } ) ;
495+ } ) ;
496+
497+ it ( 'DELETE request to uknown url returns 404 Not Found' , function ( done ) {
498+ iframeLoaded
499+ . then ( ( ) => {
500+ hpm . delete < any > ( 'route/that/does/not/exist' )
501+ . catch ( response => {
502+ expect ( response . statusCode ) . toEqual ( 404 ) ;
503+ done ( ) ;
504+ } ) ;
505+ } ) ;
506+ } ) ;
507+ } ) ;
508+
452509 describe ( 'load' , function ( ) {
453510 it ( 'POST /report/load returns 400 if the request is invalid' , function ( done ) {
454511 // Arrange
0 commit comments