Porting tests over to vitest

This commit is contained in:
Dolan Miu
2023-06-05 00:33:43 +01:00
parent a89919397d
commit e69b063687
256 changed files with 1557 additions and 612 deletions

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { beforeEach, describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -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";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import {

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -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()", () => {

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { SpaceType } from "@file/shared";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { BorderStyle } from "@file/border";

View File

@ -1,4 +1,4 @@
import { assert } from "chai";
import { assert, beforeEach, describe, it } from "vitest";
import { Utility } from "tests/utility";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";

View File

@ -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";

View File

@ -1,4 +1,4 @@
import { expect } from "chai";
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";