MCPcopy Create free account
hub / github.com/unconed/TermKit / testSession

Function testSession

Node/test.js:118–137  ·  view source on GitHub ↗

* Test session/shell handling.

(assert)

Source from the content-addressed store, hash-verified

116 * Test session/shell handling.
117 */
118function testSession(assert) {
119
120 mockClient([
121 { termkit: "1" },
122 { query: 1, method: "session.open.shell" },
123 { query: 2, method: "session.open.shell" },
124 { query: 3, method: "shell.environment", session: 1, args: { } },
125 { query: 4, method: "shell.environment", session: 2, args: { } },
126 { query: 5, method: "session.close", session: 1 },
127 { query: 6, method: "session.close", session: 2 },
128 ], function (messages, success) {
129 console.log(messages);
130 assert(messages[1].success && messages[1].args.session == 1 &&
131 messages[2].success && messages[2].args.session == 2, "Open shell session x2");
132 assert(messages[3].success && messages[3].args && messages[3].args.cwd &&
133 messages[4].success && messages[4].args && messages[4].args.cwd, "Environment is set x2");
134 assert(messages[5].success && messages[6].success, "Close shell session x2");
135 });
136
137}
138
139/**
140 * Test command handling.

Callers

nothing calls this directly

Calls 2

mockClientFunction · 0.85
assertFunction · 0.85

Tested by

no test coverage detected