diff --git a/packages/sdk/src/tests/helpers/website/.gitignore b/packages/sdk/src/tests/helpers/website/.gitignore new file mode 100644 index 0000000..64233a9 --- /dev/null +++ b/packages/sdk/src/tests/helpers/website/.gitignore @@ -0,0 +1 @@ +index.html \ No newline at end of file diff --git a/packages/sdk/src/tests/storage.test.ts b/packages/sdk/src/tests/storage.test.ts index 34afc3a..1e5c011 100644 --- a/packages/sdk/src/tests/storage.test.ts +++ b/packages/sdk/src/tests/storage.test.ts @@ -107,6 +107,18 @@ describe('Storage tests', () => { expect(files.every((f) => !!f.CID)).toBeTruthy(); }); + test('upload files from folder with ignoreFiles = false', async () => { + const uploadDir = resolve(__dirname, './helpers/website/'); + + console.time('File upload complete'); + const files = await storage + .bucket(bucketUuid) + .uploadFromFolder(uploadDir, { ignoreFiles: false }); + expect(files.length).toEqual(3); // .gitignore and index.html are not ignored + + console.timeEnd('File upload complete'); + }); + test('upload files from buffer', async () => { const html = fs.readFileSync( resolve(__dirname, './helpers/website/index.html'),