"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const node_1 = require("../node");
test("add 2+3 (async version)", async () => {
    const { exec, repr, kernel } = await (0, node_1.asyncPython)();
    await exec("a = 2+3");
    expect(await repr("a")).toBe("5");
    kernel.terminate();
});
// TODO: I have seen this test randoml fail sometimes, where
// it hangs.  Not sure why.
test("sleeping for a quarter of a second (async version)", async () => {
    const { exec, kernel } = await (0, node_1.asyncPython)();
    const t0 = new Date().valueOf();
    await exec("import time; time.sleep(0.25)");
    kernel.terminate();
    const t = new Date().valueOf() - t0;
    expect(t >= 240 && t <= 1000).toBe(true);
});
//# sourceMappingURL=python-async.test.js.map