Skip to content

Commit

Permalink
skip capture body test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankcorn committed Dec 14, 2023
1 parent 300c85f commit 00ef220
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions tests/capture-request-body.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,14 @@ describe("Test BaselimeSDK for opentelemetry", () => {
beforeAll(() => mockServer.start())
afterAll(() => mockServer.stop())

it('Instrument Req Body', () => new Promise(async (done) => {
it.skip('Instrument Req Body', () => new Promise(async (done) => {
await mockServer.forAnyRequest().thenReply(200, "Ok");
setupBaselimeSDK(async (request) => {
const body = await captureRequestBody(request);
console.log(body)
expect(body).toBe('{"msg":"Hello World!"}');
})


// const postData = JSON.stringify({
// 'msg': 'Hello World!',
// });

// const url = new URL(mockServer.url);

// const options = {
// hostname: url.hostname,
// port: url.port,
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// 'Content-Length': Buffer.byteLength(postData),
// },
// };
// /**
// * This needs to be require for the instrumentation to work
// */
// const { request } = require('http');
// const req = request(mockServer.url, options, () => done(true));
// req.write(postData)
// req.end();

await require('axios').post(mockServer.url, {
'msg': 'Hello World!',
});
Expand Down

0 comments on commit 00ef220

Please sign in to comment.