From 23b4d34ce60f89924b6eea8a00ed68bbdfc7fb03 Mon Sep 17 00:00:00 2001 From: Shubh Bapna Date: Fri, 12 Jan 2024 17:01:38 +0530 Subject: [PATCH] fix do not mock unit test --- test/unit/proxy/proxy.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/unit/proxy/proxy.test.ts b/test/unit/proxy/proxy.test.ts index 5de84bc..1228869 100644 --- a/test/unit/proxy/proxy.test.ts +++ b/test/unit/proxy/proxy.test.ts @@ -144,12 +144,13 @@ describe("http", () => { const response = await executeFile( ` const axios = require("axios"); - axios.get("http://redhat.com/").then(d => console.log(d.status)) + axios.get("http://redhat.com/").then(d => console.log(JSON.stringify({status: d.status}))); `, ip ); - - expect(response.trim()).toBe("200"); + expect(JSON.parse(response.trim())).toStrictEqual({ + status: 200 + }); }); test("mock with CONNECT request", async () => {