CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/jupyter/kernel/kernel.test.ts
Views: 687
1
/*
2
I'm a little hesistant about testing this since we'll need to make sure that a kernel is
3
installed, e.g., to test on Github actions.
4
Probably, the way to go would be to install https://www.npmjs.com/package/ijavascript
5
and just test that a lot, since it would be the minimal dependency.
6
7
There are a lot of ideas for tests in this bitrotted place:
8
9
https://github.com/sagemathinc/cocalc/tree/master/src/packages/project/jupyter/test
10
*/
11
12
import expect from "expect";
13
import { kernel } from "./kernel";
14
15
describe("test trying to use a kernel that doesn't exist", () => {
16
it("fails", async () => {
17
const k = kernel({ name: "no-such-kernel", path: "x.ipynb" });
18
await expect(k.execute_code_now({ code: "2+3" })).rejects.toThrow(
19
"No spec available for kernel"
20
);
21
});
22
});
23
24