Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/posix-node/src/socket.test.ts
1067 views
1
import posix from "./index";
2
3
test("create a socket", () => {
4
if (posix.socket == null) {
5
throw Error("socket must be defined");
6
}
7
if (posix.constants == null) {
8
throw Error("constants must be defined");
9
}
10
11
const fd = posix.socket(
12
posix.constants.AF_UNIX,
13
posix.constants.SOCK_STREAM,
14
0
15
);
16
expect(fd).toBeGreaterThan(0);
17
});
18
19