Skip to content

Commit

Permalink
test(azure-storage-blob): add native function tests
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Jan 3, 2025
1 parent 0781a55 commit 41ec93b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/drivers/azure-storage-blob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ describe.skip("drivers: azure-storage-blob", () => {
accountName: "local",
}),
additionalTests(ctx) {
it("throws when no account name", async () => {
const badDriver = driver({
connectionString: "UseDevelopmentStorage=true",
accountName: "",
});
expect(() => {
// trigger initialisation of the client
badDriver.getInstance?.();
}).toThrow("[unstorage] [azure-storage-blob] accountName");
});

it("native meta", async () => {
await ctx.storage.setItem("foo:bar", "test_data");
const meta = await ctx.storage.getMeta("foo:bar");
// undefined because we didn't access it yet
expect(meta.atime).toBe(undefined);
expect(meta.mtime?.constructor.name).toBe("Date");
});

it("natively supports depth in getKeys", async () => {
const spy = vi.spyOn(ContainerClient.prototype, "listBlobsByHierarchy");

Expand Down

0 comments on commit 41ec93b

Please sign in to comment.