pactum global configurations across different requires is a bit confusing #115
-
So, I don't know what is happening or how to solve it, neither I've been able to discover the pattern, but take for instance:
So depending on which tests run before, the URL A or B is set for the entire test execution, if that makes sense. Also, not sure if this is related, but something similar happened with the handlers. For some reason, after importing a Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
How does the 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
If a sample code is provided to replicate the issues (a github repo) , it would help us to investigate it further. |
Beta Was this translation helpful? Give feedback.
How does the
setBaseUrl
function is invoked?Is it mentioned directly on the root of the file?
Or is it wrapped inside a global hook? Usually this will work as expected
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.