diff options
Diffstat (limited to 'test/shared')
-rw-r--r-- | test/shared/operations.test.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/shared/operations.test.ts b/test/shared/operations.test.ts index 94986ac..449b25e 100644 --- a/test/shared/operations.test.ts +++ b/test/shared/operations.test.ts @@ -1,12 +1,13 @@ -import * as operations from "shared/operations"; +import * as operations from "../../src/shared/operations"; +import { expect } from "chai"; describe("operations", () => { describe("#valueOf", () => { it("returns an Operation", () => { - const op: operations.Operation = operations.valueOf({ + const op = operations.valueOf({ type: operations.SCROLL_VERTICALLY, count: 10, - }); + }) as operations.ScrollVerticallyOperation; expect(op.type).to.equal(operations.SCROLL_VERTICALLY); expect(op.count).to.equal(10); }); @@ -20,9 +21,9 @@ describe("operations", () => { }); it("fills default valus of optional parameter", () => { - const op: operations.Operation = operations.valueOf({ + const op = operations.valueOf({ type: operations.COMMAND_SHOW_OPEN, - }); + }) as operations.CommandShowOpenOperation; expect(op.type).to.equal(operations.COMMAND_SHOW_OPEN); expect(op.alter).to.be.false; @@ -37,7 +38,7 @@ describe("operations", () => { ).to.throw(TypeError); expect(() => - valueOf({ + operations.valueOf({ type: operations.COMMAND_SHOW_OPEN, alter: "true", }) |