fix(tests/settings): Improve test assertions and update local settings permissions

This commit is contained in:
2025-05-21 13:26:29 +00:00
parent a9660eda9a
commit fda1543701
4 changed files with 11 additions and 9 deletions

View File

@@ -15,13 +15,8 @@ tap.test('.fs.fileExistsSync -> should return an accurate boolean', async () =>
});
tap.test('.fs.fileExists -> should resolve or reject a promise', async () => {
expect(smartfile.fs.fileExists('./test/testassets/mytest.json')).toBeInstanceOf(Promise);
await smartfile.fs.fileExists('./test/testassets/mytest.json');
await smartfile.fs.fileExists('./test/testassets/notthere.json').catch((err) => {
return expect(err.message).toEqual(
"ENOENT: no such file or directory, access './test/testassets/notthere.json'"
);
});
await expect(smartfile.fs.fileExists('./test/testassets/mytest.json')).resolves.toBeTrue();
await expect(smartfile.fs.fileExists('./test/testassets/notthere.json')).resolves.toBeFalse();
});
tap.test('.fs.listFoldersSync() -> should get the file type from a string', async () => {