Skip to content

Commit bb78363

Browse files
committed
- fix for unittest
1 parent 2cb2660 commit bb78363

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

__tests__/context.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { jest, test, expect } from "@jest/globals";
22

33
import { makeContext } from "./fixtures/context";
4-
import { RollupContext } from "../src/context";
4+
import { RollupContext, VerbosityLevel } from "../src/context";
55

66
(global as any).console = {
77
warn: jest.fn(),
@@ -11,7 +11,7 @@ import { RollupContext } from "../src/context";
1111

1212
test("RollupContext", () => {
1313
const innerContext = makeContext();
14-
const context = new RollupContext(5, false, innerContext);
14+
const context = new RollupContext(5 as VerbosityLevel, false, innerContext);
1515

1616
context.warn("test");
1717
expect(innerContext.warn).toHaveBeenLastCalledWith("test");
@@ -40,7 +40,7 @@ test("RollupContext", () => {
4040

4141
test("RollupContext with 0 verbosity", () => {
4242
const innerContext = makeContext();
43-
const context = new RollupContext(0, false, innerContext);
43+
const context = new RollupContext(VerbosityLevel.Error, false, innerContext);
4444

4545
context.debug("verbosity is too low here");
4646
expect(innerContext.debug).not.toBeCalled();
@@ -52,7 +52,7 @@ test("RollupContext with 0 verbosity", () => {
5252

5353
test("RollupContext.error + debug negative verbosity", () => {
5454
const innerContext = makeContext();
55-
const context = new RollupContext(-100, true, innerContext);
55+
const context = new RollupContext(-100 as VerbosityLevel, true, innerContext);
5656

5757
context.error("verbosity is too low here");
5858
expect(innerContext.error).not.toBeCalled();
@@ -62,7 +62,7 @@ test("RollupContext.error + debug negative verbosity", () => {
6262

6363
test("RollupContext.error with bail", () => {
6464
const innerContext = makeContext();
65-
const context = new RollupContext(5, true, innerContext);
65+
const context = new RollupContext(5 as VerbosityLevel, true, innerContext);
6666

6767
context.error("bail");
6868
expect(innerContext.error).toHaveBeenLastCalledWith("bail");

0 commit comments

Comments
 (0)