From 6f6011182c0f16cf119019ca9bef1fadbe86b913 Mon Sep 17 00:00:00 2001 From: heerim Date: Fri, 2 Aug 2024 04:11:44 +0900 Subject: [PATCH] test: add test (shouldn't overflow when coloring already colored large text) (#74) - add error statements in case of lower node version --- tests/test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test.js b/tests/test.js index 04c99a7..7addfa7 100644 --- a/tests/test.js +++ b/tests/test.js @@ -156,6 +156,16 @@ test("non-string input", () => { assert.equal(pc.red(Infinity), FMT.red[0] + "Infinity" + FMT.red[1]) }) +test("shouldn't overflow when coloring already colored large text", () => { + try { + pc.blue(pc.red("x").repeat(10000)) + assert(true) + } catch (error){ + console.error(error) + assert(false) + } +}) + function test(name, fn) { try { fn()