mirror of
https://github.com/gchq/CyberChef
synced 2025-12-15 15:53:30 +00:00
Throw ExcludedOperationError when excluded operation is called from API
This commit is contained in:
@@ -318,4 +318,22 @@ TestRegister.addApiTests([
|
||||
assert.strictEqual(JSONDish.type, 6);
|
||||
}),
|
||||
|
||||
it("Excluded operations: throw a sensible error when you try and call one", () => {
|
||||
try {
|
||||
chef.fork();
|
||||
} catch (e) {
|
||||
assert.strictEqual(e.type, "ExcludedOperationError");
|
||||
assert.strictEqual(e.message, "Sorry, the Fork operation is not available in the Node.js version of CyberChef.");
|
||||
}
|
||||
}),
|
||||
|
||||
it("Excluded operations: throw a sensible error when you try and call one", () => {
|
||||
try {
|
||||
chef.renderImage();
|
||||
} catch (e) {
|
||||
assert.strictEqual(e.type, "ExcludedOperationError");
|
||||
assert.strictEqual(e.message, "Sorry, the RenderImage operation is not available in the Node.js version of CyberChef.");
|
||||
}
|
||||
})
|
||||
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user