expo-file-system documentDirectory is undefined?

Hi all, I am trying to write some unit tests for my little project called JetSet, in which we used expo-file-system to handle internal storage.
In my test, I wrote something like:

describe('\nsaveNewFile() is tested.\n', ()=>{
  it("An empty file is going to be created.",async ()=>{
    const path = FileSystem.documentDirectory + "testing.txt";
    promiseHolder = await FileSystem.readAsStringAsync(path).then(
        console.log("File has existed.");
        SaveData.saveNewFile("Hello from test","testing.txt");

When I run this test, result, Filesystem.documentDirectory and promiseHolder are all undefined. I feel like I did wrong in some steps but I do not realize where it is. Any helps would be great, thank you.

How can I test if the file has been saved?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.