MCPcopy Index your code
hub / github.com/parse-community/parse-server / destroyAllDataPermanently

Function destroyAllDataPermanently

src/TestUtils.js:8–28  ·  view source on GitHub ↗
(fast)

Source from the content-addressed store, hash-verified

6 * @param {boolean} fast set to true if it's ok to just drop objects and not indexes.
7 */
8export function destroyAllDataPermanently(fast) {
9 if (!process.env.TESTING) {
10 throw 'Only supported in test environment';
11 }
12 return Promise.all(
13 Object.keys(AppCache.cache).map(appId => {
14 const app = AppCache.get(appId);
15 const deletePromises = [];
16 if (app.cacheAdapter && app.cacheAdapter.clear) {
17 deletePromises.push(app.cacheAdapter.clear());
18 }
19 if (app.databaseController) {
20 deletePromises.push(app.databaseController.deleteEverything(fast));
21 } else if (app.databaseAdapter) {
22 SchemaCache.clear();
23 deletePromises.push(app.databaseAdapter.deleteAllClasses(fast));
24 }
25 return Promise.all(deletePromises);
26 })
27 );
28}
29
30export function resolvingPromise() {
31 let res;

Callers 1

ParseAPI.spec.jsFile · 0.85

Calls 4

deleteEverythingMethod · 0.80
deleteAllClassesMethod · 0.65
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected