Add tests for remove ANSI escape codes operation

This commit is contained in:
Louis-Ladd 2026-01-04 17:51:48 -07:00
parent d1d451a79c
commit 53adbca9be

View file

@ -3,4 +3,43 @@
* @copyright Crown Copyright 2025
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
"name": "Remove ANSI Escape Codes: x1b escape code",
"input": "\\x1b[31;1;3;4;9mHello, \\x1b[31;1;3;4;9mWorld!",
"expectedOutput": "Hello, World!",
"recipeConfig": [
{
"op": "Remove ANSI Escape Codes",
"args": [
],
},
],
},
{
"name": "Remove ANSI Escape Codes: 033 escape code",
"input": "\\033[32;1;3;4;9mHello, \\033[32;1;3;4;9mWorld!",
"expectedOutput": "Hello, World!",
"recipeConfig": [
{
"op": "Remove ANSI Escape Codes",
"args": [
],
},
],
},
{
"name": "Remove ANSI Escape Codes: e escape code",
"input": "\\e[32;1;3;4;9mHello, \\e[32;1;3;4;9mWorld!",
"expectedOutput": "Hello, World!",
"recipeConfig": [
{
"op": "Remove ANSI Escape Codes",
"args": [
],
},
],
}
]);