How to add the Agent and rejectUnauthorized into pactum? #282
-
Hi all, We're trying out pactumjs, and I'm stuck on how to test a local server. Currently I get a failure of
Now, that's expected, we don't care internally that the cert is invalid, and in other libraries; including nodejs, we could pass in the agent to help bypass this and get the data. import { Agent } from 'https';
const agent = new Agent({
rejectUnauthorized: false
}); How do I apply this, or the When trying, I honestly cannot find something that relates to it: //...
await spec()
.post(config.url)
.withHeaders({
'world': config.world,
'Content-Type': 'application/json',
})
.withJson({
"destination": "createSession",
"params": {
"world_id": 2081
}
})
.expectStatus(200); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Have you checked withCore? https://pactumjs.github.io/api/requests/withCore.html |
Beta Was this translation helpful? Give feedback.
-
Holy crap! That was it perfectly!
Thank you,
Kelly
…On Tue, May 9, 2023, 11:04 AM Corinna Bruchwald ***@***.***> wrote:
Have you checked withCore?
https://pactumjs.github.io/api/requests/withCore.html
—
Reply to this email directly, view it on GitHub
<#282 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIFSGANUN7PTMAAPW3DZM3XFJTKRANCNFSM6AAAAAAXXSS4DE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Have you checked withCore? https://pactumjs.github.io/api/requests/withCore.html