Files
kami-parse-server/src/TestUtils.js
Florent Vilmart 8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00

17 lines
428 B
JavaScript

import AppCache from './cache';
//Used by tests
export function destroyAllDataPermanently() {
if (!process.env.TESTING) {
throw 'Only supported in test environment';
}
return Promise.all(Object.keys(AppCache.cache).map(appId => {
const app = AppCache.get(appId);
if (app.databaseController) {
return app.databaseController.deleteEverything();
} else {
return Promise.resolve();
}
}));
}