Skip to content

Commit 45f190d

Browse files
authored
Add test waiters/callback-arrow-fn (#437)
1 parent adf104f commit 45f190d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import AWS from "aws-sdk";
2+
3+
const Bucket = "BUCKET_NAME";
4+
const client = new AWS.S3({ region: "REGION" });
5+
6+
client.waitFor("bucketExists", { Bucket }, (err, data) => {
7+
if (err) console.log(err, err.stack); // an error occurred
8+
else console.log(data); // successful response
9+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import AWS from "aws-sdk";
2+
3+
const Bucket = "BUCKET_NAME";
4+
const client = new AWS.S3({ region: "REGION" });
5+
6+
// Waiters with callbacks are not supported in AWS SDK for JavaScript (v3).
7+
// Please convert to `await client.waitFor(state, params).promise()`, and re-run aws-sdk-js-codemod.
8+
client.waitFor("bucketExists", { Bucket }, (err, data) => {
9+
if (err) console.log(err, err.stack); // an error occurred
10+
else console.log(data); // successful response
11+
});

0 commit comments

Comments
 (0)