11import { jest , test , expect } from "@jest/globals" ;
22
33import { 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
1212test ( "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
4141test ( "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
5353test ( "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
6363test ( "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