From f831bb4e9cf7c2787c90e66bb731f55dbf73f629 Mon Sep 17 00:00:00 2001 From: heerim hong Date: Sun, 21 Jul 2024 16:34:21 +0900 Subject: [PATCH] test: add test (shouldn't overflow when coloring already colored large text) - 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()