update file-system segment where checking if a file exists would always return 'true'

This commit is contained in:
Peter Kanev
2016-05-05 14:49:21 +03:00
parent 457d2bb963
commit e2b004be22

View File

@ -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