From e0a770ad7f7a6ccbdcc0d240282de040c9869c36 Mon Sep 17 00:00:00 2001 From: tbnritzdoge Date: Sun, 21 Mar 2021 01:10:51 -0400 Subject: [PATCH] feat(tests): finalize petitioresponse tests --- tests/PetitioResponse.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/PetitioResponse.test.ts b/tests/PetitioResponse.test.ts index 0641094..ae17654 100644 --- a/tests/PetitioResponse.test.ts +++ b/tests/PetitioResponse.test.ts @@ -4,6 +4,7 @@ import { PetitioResponse } from "../src/lib/PetitioResponse"; // eslint-disable-next-line sort-imports import { URL as NURL } from "url"; +// eslint-disable-next-line max-lines-per-function describe("PetitioResponse", () => { describe("JSON", () => { test("GET JSON data FROM https://jsonplaceholder.typicode.com/posts/1 STRING", async () => { @@ -53,4 +54,16 @@ describe("PetitioResponse", () => { expect(final).toEqual(data); }); }); + describe("TEXT", () => { + const text = "hi"; + const buffer = Buffer.from(text); + test("TEXT", () => { + const res = new PetitioResponse(); + res._addChunk(buffer); + + const final = res.text(); + + expect(final).toEqual(text); + }); + }); });