@@ -654,6 +654,35 @@ describe('Parse.File testing', () => {
654
654
} ) ;
655
655
} ) ;
656
656
657
+ describe ( 'getting files' , ( ) => {
658
+ it ( 'can get invalid file' , async ( ) => {
659
+ const getFile = async ( ) => {
660
+ try {
661
+ await request ( { url : 'http://localhost:8378/1/files/invalid-id/invalid-file.txt' } ) ;
662
+ } catch ( e ) {
663
+ throw new Parse . Error ( e . data . code , e . data . error ) ;
664
+ }
665
+ } ;
666
+ await expectAsync ( getFile ( ) ) . toBeRejectedWith (
667
+ new Parse . Error ( Parse . Error . OPERATION_FORBIDDEN , 'Invalid appId.' )
668
+ ) ;
669
+ const { status, data } = await request ( { url : 'http://localhost:8378/1/health' } ) ;
670
+ expect ( status ) . toEqual ( 200 ) ;
671
+ expect ( data ) . toEqual ( { status : 'ok' } ) ;
672
+ } ) ;
673
+
674
+ it ( 'can get invalid metadata' , async ( ) => {
675
+ const metadata = await request ( {
676
+ url : `http://localhost:8378/1/files/invalid-id/metadata/invalid-file.txt` ,
677
+ } ) ;
678
+ expect ( metadata . status ) . toBe ( 200 ) ;
679
+ expect ( metadata . data ) . toEqual ( { } ) ;
680
+ const { status, data } = await request ( { url : 'http://localhost:8378/1/health' } ) ;
681
+ expect ( status ) . toEqual ( 200 ) ;
682
+ expect ( data ) . toEqual ( { status : 'ok' } ) ;
683
+ } ) ;
684
+ } ) ;
685
+
657
686
xdescribe ( 'Gridstore Range tests' , ( ) => {
658
687
it ( 'supports range requests' , done => {
659
688
const headers = {
0 commit comments