fix: revert previous commit wrong file staged, added file with new test for error feature

This commit is contained in:
Jonas 2025-04-30 22:00:24 -04:00
parent 8589e06e78
commit b824268525
2 changed files with 14 additions and 1 deletions

View file

@ -46,7 +46,7 @@ class XOR extends Operation {
{
"name": "Filter Key",
"type": "boolean",
"value": false
"value": true
}
];
}

View file

@ -974,6 +974,19 @@ smothering ampersand abreast`;
"QV\u0010\u0004UDWQ");
}),
it("XOR: should throw 'Invalid Characters in key' error when key contains invalid characters", () => {
const invalidKeys = [
{ string: "zz 00 11", option: "Hex" },
{ string: "4~ 00 11", option: "Hex" }
];
invalidKeys.forEach(invalidKey => {
assert.throws(() => {
chef.XOR("fe023da5", { key: invalidKey });
}, /Invalid Characters in key/);
});
}),
it("XPath expression", () => {
assert.strictEqual(
chef.XPathExpression("<contact-info><company>abc</company></contact-info>", {xPath: "contact-info/company"}).toString(),