Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/python-wasm/src/test/default.test.ts
1067 views
1
import { asyncPython, syncPython } from "../node";
2
3
test("that the default syncPython import works", async () => {
4
const { exec, repr } = await syncPython();
5
exec("a = 2+3");
6
expect(repr("a")).toBe("5");
7
});
8
9
test("that the default asyncPython import works", async () => {
10
const { exec, repr, kernel } = await asyncPython();
11
await exec("a = 2+3");
12
expect(await repr("a")).toBe("5");
13
await kernel.terminate();
14
});
15
16