Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("should be inserted before 'hostheaderMiddleware' if exists", async () => {
const stack = new MiddlewareStack();
const mockHostheaderMiddleware = (next: any) => (args: any) => {
args.request.arr.push("two");
return next(args);
};
const mockbucketEndpointMiddleware = (next: any) => (args: any) => {
args.request.arr.push("one");
return next(args);
};
stack.add(mockHostheaderMiddleware, {
...bucketEndpointMiddlewareOptions,
name: bucketEndpointMiddlewareOptions.toMiddleware
});
stack.addRelativeTo(
mockbucketEndpointMiddleware,
bucketEndpointMiddlewareOptions
);