Skip to content

Commit

Permalink
JavaScript: Fixes two failing integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
beqqrry-aws committed Nov 11, 2024
1 parent 241c86f commit a21ba2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe("update-item", () => {
const command = new GetCommand({
TableName: tableName,
Key: { Flavor: "Vanilla" },
ConsistentRead: true,
});

const beforeResponse = await client.send(command);
Expand Down
2 changes: 1 addition & 1 deletion javascriptv3/example_code/lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Code excerpts that show you how to call individual service functions.
- [Invoke](actions/invoke.js#L5)
- [ListFunctions](actions/list-functions.js#L5)
- [UpdateFunctionCode](actions/update-function-code.js#L15)
- [UpdateFunctionConfiguration](actions/update-function-configuration.js#L12)
- [UpdateFunctionConfiguration](actions/update-function-configuration.js#L14)


<!--custom.examples.start-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import {
LambdaClient,
UpdateFunctionConfigurationCommand,
waitUntilFunctionUpdated,
} from "@aws-sdk/client-lambda";
import { readFileSync } from "node:fs";
import { dirnameFromMetaUrl } from "@aws-doc-sdk-examples/lib/utils/util-fs.js";
import { waitForFunctionUpdated } from "../waiters/index.js";

const dirname = dirnameFromMetaUrl(import.meta.url);

Expand All @@ -17,7 +19,9 @@ const updateFunctionConfiguration = (funcName) => {
...JSON.parse(config),
FunctionName: funcName,
});
return client.send(command);
const result = client.send(command);
waitForFunctionUpdated({ FunctionName: funcName });
return result;
};
/** snippet-end:[javascript.v3.lambda.actions.UpdateFunctionConfiguration] */

Expand Down

0 comments on commit a21ba2d

Please sign in to comment.