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 () {
|
export var testFileExists = function () {
|
||||||
// >> file-system-fileexists
|
// >> file-system-fileexists
|
||||||
var documents = fs.knownFolders.documents();
|
var documents = fs.knownFolders.documents();
|
||||||
var file = documents.getFile("Test.txt");
|
var filePath = fs.path.join(documents.path, "Test.txt");
|
||||||
var exists = fs.File.exists(file.path);
|
var exists = fs.File.exists(filePath);
|
||||||
// >> (hide)
|
// >> (hide)
|
||||||
TKUnit.assert(exists, "File.exists API not working.");
|
|
||||||
exists = fs.File.exists(file.path + "_");
|
|
||||||
TKUnit.assert(!exists, "File.exists API not working.");
|
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();
|
file.remove();
|
||||||
// << (hide)
|
// << (hide)
|
||||||
// << file-system-fileexists
|
// << file-system-fileexists
|
||||||
|
Reference in New Issue
Block a user