Skip to content

Commit

Permalink
feat(tests): finalize petitioresponse tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnritzdoge committed Mar 21, 2021
1 parent c8e101d commit e0a770a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/PetitioResponse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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);
});
});
});

0 comments on commit e0a770a

Please sign in to comment.