Skip to content

pactum global configurations across different requires is a bit confusing #115

Answered by ASaiAnudeep
xusoo asked this question in Q&A
Discussion options

You must be logged in to vote

How does the setBaseUrl function is invoked?

Is it mentioned directly on the root of the file?

// base.config.js
request.setBaseUrl();

Or is it wrapped inside a global hook? Usually this will work as expected

before(() => {
  request.setBaseUrl();
});

//  tests placeholder

Is the pactum instance global or does it depend on how you run/import the tests?

pactum maintains a global state. All handlers should register before they are used.

If a sample code is provided to replicate the issues (a github repo) , it would help us to investigate it further.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@xusoo
Comment options

@ASaiAnudeep
Comment options

@xusoo
Comment options

Answer selected by ASaiAnudeep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants