Skip to content

Commit

Permalink
Add unit test for upload files with ignore=false
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrov-d committed Mar 20, 2024
1 parent 029af71 commit 38d5d9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/sdk/src/tests/helpers/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
12 changes: 12 additions & 0 deletions packages/sdk/src/tests/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 38d5d9c

Please sign in to comment.