Skip to content

Commit

Permalink
- fix for unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
ezolenko committed Jun 23, 2023
1 parent 2cb2660 commit bb78363
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions __tests__/context.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jest, test, expect } from "@jest/globals";

import { makeContext } from "./fixtures/context";
import { RollupContext } from "../src/context";
import { RollupContext, VerbosityLevel } from "../src/context";

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

test("RollupContext", () => {
const innerContext = makeContext();
const context = new RollupContext(5, false, innerContext);
const context = new RollupContext(5 as VerbosityLevel, false, innerContext);

context.warn("test");
expect(innerContext.warn).toHaveBeenLastCalledWith("test");
Expand Down Expand Up @@ -40,7 +40,7 @@ test("RollupContext", () => {

test("RollupContext with 0 verbosity", () => {
const innerContext = makeContext();
const context = new RollupContext(0, false, innerContext);
const context = new RollupContext(VerbosityLevel.Error, false, innerContext);

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

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

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

test("RollupContext.error with bail", () => {
const innerContext = makeContext();
const context = new RollupContext(5, true, innerContext);
const context = new RollupContext(5 as VerbosityLevel, true, innerContext);

context.error("bail");
expect(innerContext.error).toHaveBeenLastCalledWith("bail");
Expand Down

0 comments on commit bb78363

Please sign in to comment.