Provides a mocked Parse RESTController compatible with version 1.6+
of the JavaScript SDK.
npm install parse-mockdb --save-dev
'use strict';
const Parse = require('parse-shim');
const ParseMockDB = require('parse-mockdb');
ParseMockDB.mockDB(); // Mock the Parse RESTController
// Perform saves, queries, updates, deletes, etc... using the Parse JS SDK
ParseMockDB.cleanUp(); // Clear the Database
ParseMockDB.unMockDB(); // Un-mock the Parse RESTController
- Basic CRUD (save, destroy, fetch)
- Query operators ($exists, $in, $nin, $eq, $ne, $lt, $lte, $gt, $gte, $regex, $select, $inQuery, $all, $nearSphere)
- Update operators (Increment, Add, AddUnique, Remove, Delete)
- Parse.Relation (AddRelation, RemoveRelation)
- Parse query dotted notation matching eg
{ "name.first": "Tyler" })
- Parse class level permissions
- Parse.ACL (row level permissions)
- Parse special classes (Parse.User, Parse.Role, ...)
- Parse lifecycle hooks (beforeSave - done, afterSave, beforeDelete - done, afterDelete)
npm test