mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #1092 from NativeScript/cankov/file-system-lock-test
Added a test for locks while writing and deleting a file
This commit is contained in:
@@ -598,3 +598,14 @@ export function test_FSEntity_Properties() {
|
||||
|
||||
file.remove();
|
||||
}
|
||||
|
||||
export function test_UnlockAfterWrite(done) {
|
||||
var file = fs.knownFolders.documents().getFile("Test_File_Lock.txt");
|
||||
file.writeText("Hello World!").then(() => {
|
||||
return file.readText();
|
||||
}).then(value => {
|
||||
TKUnit.assert(value === "Hello World!");
|
||||
return file.remove();
|
||||
}).then(() => done())
|
||||
.catch(done);
|
||||
}
|
||||
Reference in New Issue
Block a user