Improve use of files as input. Add dish to repl

This commit is contained in:
d98762625 committed 2018-10-05 18:06:15 +01:00
1 parent 431f1d4be0
commit 25e0585742
4 files changed
+19 -12

No files matched your search

+8
View File
@@ -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();