mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 00:36:16 -04:00
add immutable presentAs method to Dish for node REPL display. add test for exact match help
This commit is contained in:
parent
8f5f3e56cb
commit
8eed2232ee
5 changed files with 55 additions and 11 deletions
|
@ -148,12 +148,23 @@ TestRegister.addApiTests([
|
|||
}),
|
||||
|
||||
it("chef.help: lists name matches before desc matches", () => {
|
||||
const result = chef.help("Checksum");
|
||||
assert.ok(result[0].name.includes("Checksum"));
|
||||
assert.ok(result[1].name.includes("Checksum"));
|
||||
assert.strictEqual(result[result.length - 1].name.includes("Checksum"), false);
|
||||
assert.ok(result[result.length - 1].description.includes("checksum"));
|
||||
}),
|
||||
|
||||
it("chef.help: exact name match only returns one result", () => {
|
||||
const result = chef.help("MD5");
|
||||
assert.ok(result[0].name.includes("MD5"));
|
||||
assert.strictEqual(result[1].name.includes("MD5"), false);
|
||||
assert.strictEqual(result[2].name.includes("MD5"), false);
|
||||
assert.ok(result[1].description.includes("MD5"));
|
||||
assert.ok(result[2].description.includes("MD5"));
|
||||
assert.strictEqual(result.length, 1);
|
||||
assert.strictEqual(result[0].name, "MD5");
|
||||
}),
|
||||
|
||||
it("chef.help: exact match ignores whitespace", () => {
|
||||
const result = chef.help("tobase64");
|
||||
assert.strictEqual(result.length, 1);
|
||||
assert.strictEqual(result[0].name, "To Base64");
|
||||
}),
|
||||
|
||||
it("chef.bake: should exist", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue