forked from tools/josh
parent
17e8ab37a0
commit
46400c0689
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fwdekker.com",
|
||||
"version": "0.39.0",
|
||||
"version": "0.39.1",
|
||||
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
||||
"author": "Felix W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
|
|
@ -535,12 +535,12 @@ return new Command(
|
|||
return new Command(
|
||||
(input, streams) => {
|
||||
josh.environment.set("user", "");
|
||||
return ExitCode.OK;
|
||||
return parseInt(input.args[0] || "0");
|
||||
},
|
||||
\`close session\`,
|
||||
\`exit\`,
|
||||
\`Closes the terminal session.\`,
|
||||
new InputValidator({maxArgs: 0})
|
||||
new InputValidator({minArgs: 0, maxArgs: 1})
|
||||
)`,
|
||||
"false": /* language=JavaScript */ `\
|
||||
return new Command(
|
||||
|
|
|
@ -360,10 +360,24 @@ describe("commands", () => {
|
|||
beforeEach(() => loadCommand("exit"));
|
||||
|
||||
|
||||
it("changes the current user", () => {
|
||||
it("removes the current user", () => {
|
||||
environment.set("user", "wish");
|
||||
|
||||
expect(execute("exit")).to.equal(ExitCode.OK);
|
||||
expect(environment.get("user")).to.equal("");
|
||||
});
|
||||
|
||||
it("has exit code of OK by default", () => {
|
||||
environment.set("status", "9");
|
||||
|
||||
expect(execute("exit")).to.equal(ExitCode.OK);
|
||||
});
|
||||
|
||||
it("returns the user-supplied exit code", () => {
|
||||
environment.set("status", "1");
|
||||
|
||||
expect(execute("exit 46")).to.equal(46);
|
||||
});
|
||||
});
|
||||
|
||||
describe("false", () => {
|
||||
|
|
Loading…
Reference in New Issue