forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose DatabaseAdapter to simplify application tests (parse-community…
…#1121) * Move helper.clearData to DatabaseAdapter. Expose DatabaseAdapter in index * fix indentation * Export DatabaseAdapter in index.js * Rename clearData to destroyAllDataPermanently. Only export destroyAllDataPermanently from DatabaseAdapter. Update helper * Expose wrapped TestUtils from index.js. TestUtils exposed select functions from other modules, only in test environment
- Loading branch information
1 parent
ab6925a
commit 30197a7
Showing
4 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { destroyAllDataPermanently } from './DatabaseAdapter'; | ||
|
||
let unsupported = function() { | ||
throw 'Only supported in test environment'; | ||
}; | ||
|
||
let _destroyAllDataPermanently; | ||
if (process.env.TESTING) { | ||
_destroyAllDataPermanently = destroyAllDataPermanently; | ||
} else { | ||
_destroyAllDataPermanently = unsupported; | ||
} | ||
|
||
export default { | ||
destroyAllDataPermanently: _destroyAllDataPermanently}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters