mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
update file-system segment where checking if a file exists would always return 'true'
This commit is contained in:
@ -336,12 +336,13 @@ export var testFileNameExtension = function () {
|
||||
export var testFileExists = function () {
|
||||
// >> file-system-fileexists
|
||||
var documents = fs.knownFolders.documents();
|
||||
var file = documents.getFile("Test.txt");
|
||||
var exists = fs.File.exists(file.path);
|
||||
var filePath = fs.path.join(documents.path, "Test.txt");
|
||||
var exists = fs.File.exists(filePath);
|
||||
// >> (hide)
|
||||
TKUnit.assert(exists, "File.exists API not working.");
|
||||
exists = fs.File.exists(file.path + "_");
|
||||
TKUnit.assert(!exists, "File.exists API not working.");
|
||||
var file = documents.getFile("Test.txt");
|
||||
exists = fs.File.exists(file.path);
|
||||
TKUnit.assert(exists, "File.exists API not working.");
|
||||
file.remove();
|
||||
// << (hide)
|
||||
// << file-system-fileexists
|
||||
|
Reference in New Issue
Block a user