* 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
17 lines
428 B
JavaScript
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();
|
|
}
|
|
}));
|
|
}
|