Skip to content

Commit

Permalink
Add integration test for uploading empty buffer to storage emulator (#…
Browse files Browse the repository at this point in the history
…4841)

* add integration test for uploading empty buffer

* lint
  • Loading branch information
tonyjhuang committed Aug 9, 2022
1 parent 911fdad commit a2ecf29
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/storage-emulator-integration/tests.ts
Expand Up @@ -1365,6 +1365,16 @@ hello there!
expect(uploadState).to.equal("success");
});

it("should handle uploading empty buffer", async () => {
await signInToFirebaseAuth(page);
const uploadState = await page.evaluate(async () => {
const task = await firebase.storage().ref("testing/empty_file").put(new ArrayBuffer(0));
return task.state;
});

expect(uploadState).to.equal("success");
});

it("should upload a file with custom metadata", async () => {
const uploadState = await page.evaluate(async (IMAGE_FILE_BASE64) => {
const task = await firebase
Expand Down

0 comments on commit a2ecf29

Please sign in to comment.