Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiClientConfigurator: getCustomMiddleware #561

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nicolasmondain
Copy link

ApiClientConfigurator.getMiddleware is now using:

  • this.getHeaderMiddleware
  • this.getHttpAgentMiddleware
  • this.getCustomMiddleware
nicolasmondain@MBP-de-Nicolas hubspot-api-nodejs % npm run test          

> @hubspot/[email protected] test
> ts-node node_modules/jasmine/bin/jasmine --config=jasmine.json

Randomized with seed 63752
Started
......................................................................


70 specs, 0 failures
Finished in 0.081 seconds
Randomized with seed 63752 (jasmine --random=true --seed=63752)

Please note that all our unit tests are passing (using the new config.middleware option).

new Client({
    accessToken: ACCESS_TOKEN,
    middleware: [{
        async pre(ctx) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            return ctx;
        },
        async post(ctx) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            return ctx;
        },
    }],
});

@nicolasmondain
Copy link
Author

#560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant