Improve import alias

@file/ and @export/ instead of file/ and export/ etc
This commit is contained in:
Dolan Miu
2022-06-26 23:26:42 +01:00
parent c19bc6b4b3
commit 982d923553
380 changed files with 758 additions and 521 deletions

View File

@ -0,0 +1,33 @@
import { expect } from "chai";
import { convertInchesToTwip, convertMillimetersToTwip, uniqueId, uniqueNumericId } from "./convenience-functions";
describe("Utility", () => {
describe("#convertMillimetersToTwip", () => {
it("should call the underlying header's addChildElement for Paragraph", () => {
expect(convertMillimetersToTwip(1000)).to.equal(56692);
});
});
describe("#convertInchesToTwip", () => {
it("should call the underlying header's addChildElement", () => {
expect(convertInchesToTwip(1)).to.equal(1440);
expect(convertInchesToTwip(0.5)).to.equal(720);
expect(convertInchesToTwip(0.25)).to.equal(360);
});
});
describe("#uniqueNumericId", () => {
it("should generate a unique incrementing ID", () => {
// tslint:disable-next-line: no-unused-expression
expect(uniqueNumericId()).to.not.be.undefined;
});
});
describe("#uniqueId", () => {
it("should generate a unique pseudorandom ID", () => {
// tslint:disable-next-line: no-unused-expression
expect(uniqueId()).to.not.be.empty;
});
});
});