diff options
Diffstat (limited to 'test/console/commandline')
-rw-r--r-- | test/console/commandline/CommandLineParser.test.ts | 13 | ||||
-rw-r--r-- | test/console/commandline/CommandParser.test.ts | 9 |
2 files changed, 10 insertions, 12 deletions
diff --git a/test/console/commandline/CommandLineParser.test.ts b/test/console/commandline/CommandLineParser.test.ts index 7cba04c..d187e1e 100644 --- a/test/console/commandline/CommandLineParser.test.ts +++ b/test/console/commandline/CommandLineParser.test.ts @@ -2,27 +2,26 @@ import CommandLineParser, { InputPhase, } from "../../../src/console/commandline/CommandLineParser"; import { Command } from "../../../src/shared/Command"; -import { expect } from "chai"; describe("CommandLineParser", () => { describe("#inputPhase", () => { it("returns parsed command-line", () => { const sut = new CommandLineParser(); - expect(sut.inputPhase("")).to.equal(InputPhase.OnCommand); - expect(sut.inputPhase("op")).to.equal(InputPhase.OnCommand); - expect(sut.inputPhase("open ")).to.equal(InputPhase.OnArgs); - expect(sut.inputPhase("open apple")).to.equal(InputPhase.OnArgs); + expect(sut.inputPhase("")).toEqual(InputPhase.OnCommand); + expect(sut.inputPhase("op")).toEqual(InputPhase.OnCommand); + expect(sut.inputPhase("open ")).toEqual(InputPhase.OnArgs); + expect(sut.inputPhase("open apple")).toEqual(InputPhase.OnArgs); }); }); describe("#parse", () => { it("returns parsed command-line", () => { const sut = new CommandLineParser(); - expect(sut.parse("open google apple")).to.deep.equal({ + expect(sut.parse("open google apple")).toEqual({ command: Command.Open, args: "google apple", }); - expect(sut.parse("qa")).to.deep.equal({ + expect(sut.parse("qa")).toEqual({ command: Command.QuitAll, args: "", }); diff --git a/test/console/commandline/CommandParser.test.ts b/test/console/commandline/CommandParser.test.ts index f72afd6..a8e82df 100644 --- a/test/console/commandline/CommandParser.test.ts +++ b/test/console/commandline/CommandParser.test.ts @@ -2,16 +2,15 @@ import CommandParser, { UnknownCommandError, } from "../../../src/console/commandline/CommandParser"; import { Command } from "../../../src/shared/Command"; -import { expect } from "chai"; describe("CommandParser", () => { describe("#parse", () => { it("returns matched command with the string", () => { const sut = new CommandParser(); - expect(sut.parse("open")).to.equal(Command.Open); - expect(sut.parse("w")).to.equal(Command.WindowOpen); - expect(sut.parse("bdelete!")).to.equal(Command.BufferDeleteForce); - expect(() => sut.parse("harakiri")).to.throw(UnknownCommandError); + expect(sut.parse("open")).toEqual(Command.Open); + expect(sut.parse("w")).toEqual(Command.WindowOpen); + expect(sut.parse("bdelete!")).toEqual(Command.BufferDeleteForce); + expect(() => sut.parse("harakiri")).toThrow(UnknownCommandError); }); }); }); |