Fix tests and build
Remove unused code and dependencies
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { assert, beforeEach, describe, expect, it } from "vitest";
|
||||
import * as sinon from "sinon";
|
||||
import { assert, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { Formatter } from "@export/formatter";
|
||||
import { CoreProperties } from "@file/core-properties";
|
||||
@ -109,10 +108,10 @@ describe("Formatter", () => {
|
||||
|
||||
it("should call the prep method only once", () => {
|
||||
const paragraph = new Paragraph("");
|
||||
const spy = sinon.spy(paragraph, "prepForXml");
|
||||
const spy = vi.spyOn(paragraph, "prepForXml");
|
||||
|
||||
formatter.format(paragraph);
|
||||
expect(spy.calledOnce).to.equal(true);
|
||||
expect(spy).toBeCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,5 @@
|
||||
/* tslint:disable:typedef space-before-function-paren */
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import * as sinon from "sinon";
|
||||
import * as fflate from "fflate";
|
||||
|
||||
import { File } from "@file/file";
|
||||
@ -140,10 +139,10 @@ describe("Compiler", () => {
|
||||
});
|
||||
|
||||
// tslint:disable-next-line: no-string-literal
|
||||
const spy = sinon.spy(compiler["formatter"], "format");
|
||||
const spy = vi.spyOn(compiler["formatter"], "format");
|
||||
|
||||
compiler.compile(file);
|
||||
expect(spy.callCount).to.equal(13);
|
||||
expect(spy).toBeCalledTimes(13);
|
||||
});
|
||||
|
||||
it("should work with media datas", () => {
|
||||
@ -179,8 +178,7 @@ describe("Compiler", () => {
|
||||
],
|
||||
});
|
||||
|
||||
// tslint:disable-next-line: no-string-literal
|
||||
sinon.stub(compiler["imageReplacer"], "getMediaData").returns([
|
||||
vi.spyOn(compiler["imageReplacer"], "getMediaData").mockReturnValue([
|
||||
{
|
||||
stream: Buffer.from(""),
|
||||
fileName: "test",
|
||||
|
Reference in New Issue
Block a user