mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Application-Settings: Non-blocking changes (#5091)
* fix(app-settings): changes are now non-blocking * chore(app-settings): return result of flush to disk * chore(app-settings): added test for flush
This commit is contained in:
committed by
Svetoslav
parent
634cf9a822
commit
1615061591
@@ -102,6 +102,16 @@ export var testClear = function () {
|
||||
TKUnit.assert(!appSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
|
||||
};
|
||||
|
||||
export var testFlush = function () {
|
||||
appSettings.setString(stringKey, "String value");
|
||||
// >> application-settings-flush
|
||||
var flushed = appSettings.flush();
|
||||
// will return boolean indicating whether flush to disk was successful
|
||||
// << application-settings-flush
|
||||
TKUnit.assert(flushed, "Flush failed: "+ flushed);
|
||||
TKUnit.assert(appSettings.hasKey(stringKey), "There is no key: " + stringKey);
|
||||
};
|
||||
|
||||
export var testInvalidKey = function () {
|
||||
try {
|
||||
appSettings.hasKey(undefined);
|
||||
|
||||
Reference in New Issue
Block a user