Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Jul 9, 2024
1 parent 29c6bb1 commit 673d216
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/transfer-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,22 @@ describe('Transfer Manager', () => {

it('allows the user to apply a custom destination transformation when supplied a custom function', async () => {
const paths = ['a', 'b', 'foo/bar', 'bar.txt'];
const expected = ['foo/a', 'b/bar', 'foo/foo/bar', 'bar.txt/bar']
const expected = ['foo/a', 'b/bar', 'foo/foo/bar', 'bar.txt/bar'];
sandbox.stub(bucket, 'upload').callsFake((path, options) => {
const uploadOpts = options as UploadOptions;
assert(expected.includes(uploadOpts.destination as string));
});

let callCount = 0;
const transformationFunc = (path: string, options: UploadManyFilesOptions) => {
return expected[callCount++]
const transformationFunc = (
path: string,

Check warning on line 188 in test/transfer-manager.ts

View workflow job for this annotation

GitHub Actions / lint

'path' is defined but never used
options: UploadManyFilesOptions

Check warning on line 189 in test/transfer-manager.ts

View workflow job for this annotation

GitHub Actions / lint

'options' is defined but never used
) => {
return expected[callCount++];
};
await transferManager.uploadManyFiles(paths, {customDestinationBuilder: transformationFunc});
await transferManager.uploadManyFiles(paths, {
customDestinationBuilder: transformationFunc,
});
});
});

Expand Down

0 comments on commit 673d216

Please sign in to comment.