Skip to content

Commit

Permalink
test: add test (shouldn't overflow when coloring already colored larg…
Browse files Browse the repository at this point in the history
…e text) (#74)

- add error statements in case of lower node version
  • Loading branch information
Henry-Hong authored Aug 1, 2024
1 parent 1d7a86d commit 6f60111
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6f60111

Please sign in to comment.