ShellState, SessionState implemented, all tested, and passing
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { createInitialSessionState } from "@core/session";
|
||||
import type { UserInfo } from "@core/user_info";
|
||||
import { expect, test } from "vitest";
|
||||
|
||||
const user: UserInfo = {
|
||||
name: "root",
|
||||
uid: 0,
|
||||
gid: 0,
|
||||
group: [0],
|
||||
home: 0,
|
||||
};
|
||||
|
||||
test("createInitialSessionState - successfully creates a new session state", () => {
|
||||
const state = createInitialSessionState(user);
|
||||
|
||||
expect(state.cwd).toEqual(user.home);
|
||||
expect(state.pwd).toEqual(user.home);
|
||||
expect(state.exitCode).toEqual(0);
|
||||
expect(state.user).toBe(user);
|
||||
expect(Object.isFrozen(state)).toBe(true);
|
||||
});
|
||||
Reference in New Issue
Block a user