File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,13 @@ describe('Parse Query', () => {
7070 assert . strictEqual ( result . foo , 'bar' ) ;
7171 assert . strictEqual ( result . className , 'TestObject' ) ;
7272 assert . strictEqual ( result . objectId , object . id ) ;
73+
74+ await query . each ( ( obj ) => {
75+ assert . strictEqual ( obj instanceof Parse . Object , false ) ;
76+ assert . strictEqual ( obj . foo , 'bar' ) ;
77+ assert . strictEqual ( obj . className , 'TestObject' ) ;
78+ assert . strictEqual ( obj . objectId , object . id ) ;
79+ } , { json : true } ) ;
7380 } ) ;
7481
7582 it ( 'can do query with count' , async ( ) => {
Original file line number Diff line number Diff line change @@ -990,6 +990,9 @@ class ParseQuery {
990990 if ( options . hasOwnProperty ( 'context' ) && typeof options . context === 'object' ) {
991991 findOptions . context = options . context ;
992992 }
993+ if ( options . hasOwnProperty ( 'json' ) ) {
994+ findOptions . json = options . json ;
995+ }
993996
994997 let finished = false ;
995998 let previousResults = [ ] ;
@@ -1030,6 +1033,7 @@ class ParseQuery {
10301033 * be used for this request.
10311034 * <li>sessionToken: A valid session token, used for making a request on
10321035 * behalf of a specific user.
1036+ * <li>json: Return raw json without converting to Parse.Object
10331037 * </ul>
10341038 * @returns {Promise } A promise that will be fulfilled once the
10351039 * iteration has completed.
Original file line number Diff line number Diff line change @@ -1376,6 +1376,13 @@ describe('ParseQuery', () => {
13761376 expect ( result . size ) . toBe ( 'small' ) ;
13771377 expect ( result . name ) . toEqual ( 'Product 3' ) ;
13781378 expect ( result . className ) . toEqual ( 'Item' ) ;
1379+
1380+ await q . each ( ( obj ) => {
1381+ expect ( obj . objectId ) . toBe ( 'I1' ) ;
1382+ expect ( obj . size ) . toBe ( 'small' ) ;
1383+ expect ( obj . name ) . toEqual ( 'Product 3' ) ;
1384+ expect ( obj . className ) . toEqual ( 'Item' ) ;
1385+ } , { json : true } ) ;
13791386 } ) ;
13801387
13811388 it ( 'will error when getting a nonexistent object' , done => {
You can’t perform that action at this time.
0 commit comments