Porting tests over to vitest
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { Alignment, AlignmentType } from "./alignment";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { assert } from "chai";
|
||||
import { assert, beforeEach, describe, it } from "vitest";
|
||||
|
||||
import { Utility } from "tests/utility";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { HorizontalPositionAlign, VerticalPositionAlign } from "@file/shared";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { assert, expect } from "chai";
|
||||
import { assert, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { Utility } from "tests/utility";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { PageReferenceFieldInstruction } from "./pageref-field-instruction";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { PageReference } from "./pageref";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { MathPreSubSuperScriptProperties } from "./math-pre-sub-super-script-function-properties";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { MathSubScriptProperties } from "./math-sub-script-function-properties";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { MathSubSuperScriptProperties } from "./math-sub-super-script-function-properties";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { MathSuperScriptProperties } from "./math-super-script-function-properties";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { assert, expect } from "chai";
|
||||
import { SinonStub, stub } from "sinon";
|
||||
import { afterEach, assert, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import * as convenienceFunctions from "@util/convenience-functions";
|
||||
|
||||
@ -18,14 +17,13 @@ import { Paragraph } from "./paragraph";
|
||||
import { TextRun } from "./run";
|
||||
|
||||
describe("Paragraph", () => {
|
||||
before(() => {
|
||||
stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id");
|
||||
stub(convenienceFunctions, "bookmarkUniqueNumericIdGen").callsFake(() => () => -101);
|
||||
beforeEach(() => {
|
||||
vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test-unique-id");
|
||||
vi.spyOn(convenienceFunctions, "bookmarkUniqueNumericIdGen").mockReturnValue(() => -101);
|
||||
});
|
||||
|
||||
after(() => {
|
||||
(convenienceFunctions.uniqueId as SinonStub).restore();
|
||||
(convenienceFunctions.bookmarkUniqueNumericIdGen as SinonStub).restore();
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe("#constructor()", () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { DocumentWrapper } from "../document-wrapper";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import * as sinon from "sinon";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { SinonStub, stub } from "sinon";
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { IViewWrapper } from "@file/document-wrapper";
|
||||
@ -9,12 +8,12 @@ import * as convenienceFunctions from "@util/convenience-functions";
|
||||
import { ImageRun } from "./image-run";
|
||||
|
||||
describe("ImageRun", () => {
|
||||
before(() => {
|
||||
stub(convenienceFunctions, "uniqueId").callsFake(() => "test-unique-id");
|
||||
beforeAll(() => {
|
||||
vi.spyOn(convenienceFunctions, "uniqueId").mockReturnValue("test-unique-id");
|
||||
});
|
||||
|
||||
after(() => {
|
||||
(convenienceFunctions.uniqueId as SinonStub).restore();
|
||||
afterAll(() => {
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
describe("#constructor()", () => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { SpaceType } from "@file/shared";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { BorderStyle } from "@file/border";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { assert } from "chai";
|
||||
import { assert, beforeEach, describe, it } from "vitest";
|
||||
|
||||
import { Utility } from "tests/utility";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { FootnoteReferenceRun } from "@file/footnotes/footnote/run/reference-run";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect } from "chai";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
|
||||
|
Reference in New Issue
Block a user