Skip to content

Commit

Permalink
Update test to validate that error contains details
Browse files Browse the repository at this point in the history
  • Loading branch information
joheredi committed Oct 22, 2019
1 parent f8aa7a3 commit 0fc9d8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdk/storage/storage-blob/test/appendblobclient.spec.ts
Expand Up @@ -122,6 +122,12 @@ describe("AppendBlobClient", () => {
if (err instanceof Error && err.message.indexOf("Crc64Mismatch") != -1) {
exceptionCaught = true;
}

assert.equal(
err.details.errorCode,
"Crc64Mismatch",
"Error does not contain details property"
);
}

assert.ok(exceptionCaught);
Expand Down
5 changes: 5 additions & 0 deletions sdk/storage/storage-file/test/directoryclient.spec.ts
Expand Up @@ -596,6 +596,11 @@ describe("DirectoryClient", () => {
);
} catch (error) {
assert.ok((error.statusCode as number) === 404);
assert.equal(
error.details.errorCode,
"ResourceNotFound",
"Error does not contain details property"
);
}
await subDirClient.delete({ spanOptions });

Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-queue/test/queueserviceclient.spec.ts
Expand Up @@ -338,6 +338,7 @@ describe("QueueServiceClient", () => {
} catch (error) {
err = error;
}
assert.equal(err.details.errorCode, "QueueNotFound", "Error does not contain details property");
assert.ok(err.message.includes("QueueNotFound"), "Error doesn't say `QueueNotFound`");
});
});

0 comments on commit 0fc9d8c

Please sign in to comment.