Parse args sent through evaluation function

Previously they'd go in still stringified so we didn't get a chance to
convert buffer objects back to buffers, for example, making things like
`fs.write` write `[object Object]` to files.
This commit is contained in:
Asher
2019-02-21 14:09:07 -06:00
parent fe107802e3
commit 7edf797efc
4 changed files with 20 additions and 10 deletions

View File

@@ -12,10 +12,17 @@ const net = require("../src/fill/net") as typeof import("net");
describe("net", () => {
let i = 0;
const coderDir = path.join(os.tmpdir(), "coder");
const coderDir = path.join(os.tmpdir(), "coder", "net");
const tmpFile = (): string => path.join(coderDir, `socket.${i++}`);
beforeAll(async () => {
try {
await util.promisify(fs.mkdir)(path.dirname(coderDir));
} catch (error) {
if (error.code !== "EEXIST") {
throw error;
}
}
await util.promisify(rimraf)(coderDir);
await util.promisify(fs.mkdir)(coderDir);
});