ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
24 lines (22 loc) • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const manipulation_1 = require("./../../manipulation");
describe("verifyAndGetIndex", () => {
it("should get the index when zero and length is zero", () => {
chai_1.expect(manipulation_1.verifyAndGetIndex(0, 0)).to.equal(0);
});
it("should get the index when equal to length", () => {
chai_1.expect(manipulation_1.verifyAndGetIndex(1, 1)).to.equal(1);
});
it("should get the index when equal to length * 1", () => {
chai_1.expect(manipulation_1.verifyAndGetIndex(-1, 1)).to.equal(0);
});
it("should throw the index greater than length", () => {
chai_1.expect(() => manipulation_1.verifyAndGetIndex(2, 1)).to.throw();
});
it("should throw the index greater than length * -1", () => {
chai_1.expect(() => manipulation_1.verifyAndGetIndex(-2, 1)).to.throw();
});
});
//# sourceMappingURL=verifyAndGetIndexTests.js.map