Archived
1
0

Add active evals (#25)

* Add active evals

* Convert type of stats to date or string

* Fix generic overloads for run

* Lower evaluate timeout

* Add comment for createWriteStream
This commit is contained in:
Kyle Carberry
2019-01-29 18:48:02 -06:00
parent 3a88ae5fb2
commit 20f5d8eeed
13 changed files with 640 additions and 40 deletions

View File

@ -55,4 +55,18 @@ describe("Evaluate", () => {
expect(value).toEqual("donkey");
}, 250);
it("should do active process", (done) => {
const runner = client.run((ae) => {
ae.on("1", () => {
ae.emit("2");
ae.on("3", () => {
ae.emit("close");
});
});
});
runner.emit("1");
runner.on("2", () => runner.emit("3"));
runner.on("close", () => done());
});
});

View File

@ -117,6 +117,23 @@ describe("fs", () => {
});
});
describe("createWriteStream", () => {
it("should write to file", (done) => {
const file = tmpFile();
const content = "howdy\nhow\nr\nu";
const stream = fs.createWriteStream(file);
stream.on("open", (fd) => {
expect(fd).toBeDefined();
stream.write(content);
stream.close();
});
stream.on("close", () => {
expect(nativeFs.readFileSync(file).toString()).toEqual(content);
done();
});
});
});
describe("exists", () => {
it("should output file exists", (done) => {
fs.exists(testFile, (exists) => {