fix(core): update

This commit is contained in:
Philipp Kunz 2021-12-22 19:08:53 +01:00
parent 0000984e4b
commit bcb66b2ccf
2 changed files with 5 additions and 1 deletions

View File

@ -213,4 +213,8 @@ tap.test('should create, store and retrieve valid smartfiles', async () => {
expect(retrievedString).to.equal(fileString); expect(retrievedString).to.equal(fileString);
}); });
tap.test('should wait for file to be ready', async () => {
await smartfile.fs.waitForFileToBeReady('./test/testassets/mytest.json')
})
tap.start(); tap.start();

View File

@ -388,7 +388,7 @@ export const waitForFileToBeReady = async (filePathArg: string): Promise<void> =
limitedArray.addOne(stats.size); limitedArray.addOne(stats.size);
if ( if (
limitedArray.array.length < 3 || limitedArray.array.length < 3 ||
!(limitedArray.array[0] === limitedArray[1] && limitedArray.array[1] === limitedArray[2]) !(limitedArray.array[0] === limitedArray.array[1] && limitedArray.array[1] === limitedArray.array[2])
) { ) {
await plugins.smartdelay.delayFor(5000); await plugins.smartdelay.delayFor(5000);
} else { } else {