mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 16:26:16 -04:00
Improve use of files as input. Add dish to repl
This commit is contained in:
parent
431f1d4be0
commit
25e0585742
4 changed files with 19 additions and 12 deletions
|
@ -15,6 +15,7 @@ import it from "../assertionHandler";
|
|||
import chef from "../../../src/node/index";
|
||||
import OperationError from "../../../src/core/errors/OperationError";
|
||||
import SyncDish from "../../../src/node/SyncDish";
|
||||
import fs from "fs";
|
||||
|
||||
import { toBase32, Dish } from "../../../src/node/index";
|
||||
import TestRegister from "../../TestRegister";
|
||||
|
@ -349,6 +350,13 @@ TestRegister.addApiTests([
|
|||
assert.strictEqual(JSONDish.type, 6);
|
||||
}),
|
||||
|
||||
it("Composable dish: Buffer type dishes should be converted to strings", () => {
|
||||
fs.writeFileSync("test.txt", "abc");
|
||||
const dish = new Dish(fs.readFileSync("test.txt"));
|
||||
assert.strictEqual(dish.type, 4);
|
||||
fs.unlinkSync("test.txt");
|
||||
}),
|
||||
|
||||
it("Excluded operations: throw a sensible error when you try and call one", () => {
|
||||
try {
|
||||
chef.fork();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue