| 143 | }; |
| 144 | |
| 145 | function checkObjectData(s3, bucket, objectKey, dataValue, done) { |
| 146 | s3.send(new GetObjectCommand({ |
| 147 | Bucket: bucket, |
| 148 | Key: objectKey, |
| 149 | })).then(async data => { |
| 150 | try { |
| 151 | const body = await data.Body.transformToString(); |
| 152 | assert.strictEqual(body, dataValue); |
| 153 | return done(); |
| 154 | } catch (err) { |
| 155 | return done(err); |
| 156 | } |
| 157 | }).catch(err => done(err)); |
| 158 | } |
| 159 | |
| 160 | function checkVersionData(s3, bucket, objectKey, versionId, dataValue, done) { |
| 161 | return s3.send(new GetObjectCommand({ |