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', () => {
70
70
assert . strictEqual ( result . foo , 'bar' ) ;
71
71
assert . strictEqual ( result . className , 'TestObject' ) ;
72
72
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 } ) ;
73
80
} ) ;
74
81
75
82
it ( 'can do query with count' , async ( ) => {
Original file line number Diff line number Diff line change @@ -990,6 +990,9 @@ class ParseQuery {
990
990
if ( options . hasOwnProperty ( 'context' ) && typeof options . context === 'object' ) {
991
991
findOptions . context = options . context ;
992
992
}
993
+ if ( options . hasOwnProperty ( 'json' ) ) {
994
+ findOptions . json = options . json ;
995
+ }
993
996
994
997
let finished = false ;
995
998
let previousResults = [ ] ;
@@ -1030,6 +1033,7 @@ class ParseQuery {
1030
1033
* be used for this request.
1031
1034
* <li>sessionToken: A valid session token, used for making a request on
1032
1035
* behalf of a specific user.
1036
+ * <li>json: Return raw json without converting to Parse.Object
1033
1037
* </ul>
1034
1038
* @returns {Promise } A promise that will be fulfilled once the
1035
1039
* iteration has completed.
Original file line number Diff line number Diff line change @@ -1376,6 +1376,13 @@ describe('ParseQuery', () => {
1376
1376
expect ( result . size ) . toBe ( 'small' ) ;
1377
1377
expect ( result . name ) . toEqual ( 'Product 3' ) ;
1378
1378
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 } ) ;
1379
1386
} ) ;
1380
1387
1381
1388
it ( 'will error when getting a nonexistent object' , done => {
You can’t perform that action at this time.
0 commit comments