Skip to content

Commit

Permalink
JavaScript (v3): Unit tests - Fix incorrect link in S3 unit tests com…
Browse files Browse the repository at this point in the history
…ments.
  • Loading branch information
cpyle0819 committed Jan 14, 2025
1 parent 996db24 commit f701281
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 76 deletions.
4 changes: 2 additions & 2 deletions javascriptv3/example_code/s3/tests/copy-object.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe("copy-object", () => {

it("should log a relevant error message if the object is in an archive tier", async () => {
const error = new ObjectNotInActiveTierError();
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
send.mockRejectedValue(error);

const spy = vi.spyOn(console, "error");
Expand Down
8 changes: 4 additions & 4 deletions javascriptv3/example_code/s3/tests/create-bucket.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe("create-bucket", () => {

it("should log a relevant error message if a bucket already exists globally", async () => {
const error = new BucketAlreadyExists();
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
send.mockRejectedValue(error);

const spy = vi.spyOn(console, "error");
Expand All @@ -49,8 +49,8 @@ describe("create-bucket", () => {

it("should log a relevant error message if a bucket already exists in the users AWS account", async () => {
const error = new BucketAlreadyOwnedByYou();
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
send.mockRejectedValue(error);

const spy = vi.spyOn(console, "error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ describe("delete-bucket-policy", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -50,8 +50,8 @@ describe("delete-bucket-policy", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const { main } = await import("../actions/delete-bucket-website.js");
describe("delete-bucket-website", () => {
it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -38,8 +38,8 @@ describe("delete-bucket-website", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
8 changes: 4 additions & 4 deletions javascriptv3/example_code/s3/tests/delete-bucket.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ describe("delete-bucket", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
send.mockRejectedValueOnce(error);

Expand All @@ -47,8 +47,8 @@ describe("delete-bucket", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
send.mockRejectedValueOnce(error);

Expand Down
8 changes: 4 additions & 4 deletions javascriptv3/example_code/s3/tests/delete-object.unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe("delete-object", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -51,8 +51,8 @@ describe("delete-object", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ describe("delete-objects", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -53,8 +53,8 @@ describe("delete-objects", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ describe("get-bucket-acl", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -53,8 +53,8 @@ describe("get-bucket-acl", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ describe("get-bucket-cors", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -66,8 +66,8 @@ describe("get-bucket-cors", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ describe("get-bucket-policy", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -50,8 +50,8 @@ describe("get-bucket-policy", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe("get-bucket-website", () => {

it("should log a relevant error when the bucket isn't configured as a website.", async () => {
const error = new S3ServiceException("Not such website configuration.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchWebsiteConfiguration";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -55,8 +55,8 @@ describe("get-bucket-website", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ describe("get-object-lock-configuration", () => {

it("should log a relevant error when the bucket doesn't exist", async () => {
const error = new S3ServiceException("The specified bucket does not exist");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "NoSuchBucket";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand All @@ -50,8 +50,8 @@ describe("get-object-lock-configuration", () => {

it("should indicate a failure came from S3 when the error isn't generic", async () => {
const error = new S3ServiceException("Some S3 service exception.");
error.$fault = "server"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$metadata = "metadata"; // Workaround until PR is released. https://code.amazon.com/reviews/CR-171722725/revisions/1#/reviewers
error.$fault = "server"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.$metadata = "metadata"; // Workaround until PR is released. https://github.com/smithy-lang/smithy-typescript/pull/1503
error.name = "ServiceException";
const bucketName = "amzn-s3-demo-bucket";
send.mockRejectedValueOnce(error);
Expand Down
Loading

0 comments on commit f701281

Please sign in to comment.