@@ -3,7 +3,7 @@ import { setImmediate } from 'node:timers/promises'
33
44import test from 'ava'
55import ModernError from 'modern-errors'
6- import sinon from 'sinon'
6+ import { stub , spy } from 'sinon'
77import { each } from 'test-each'
88
99import modernErrorsProcess from 'modern-errors-process'
@@ -30,7 +30,7 @@ const createProcessError = async (error) => {
3030
3131test . serial ( 'Prints on the console by default' , async ( t ) => {
3232 // eslint-disable-next-line no-restricted-globals
33- const consoleError = sinon . stub ( console , 'error' )
33+ const consoleError = stub ( console , 'error' )
3434 const stopLogging = BaseError . logProcess ( )
3535 const error = new BaseError ( 'test' )
3636 await createProcessError ( error )
@@ -40,7 +40,7 @@ test.serial('Prints on the console by default', async (t) => {
4040} )
4141
4242test . serial ( 'Handles process errors' , async ( t ) => {
43- const onError = sinon . spy ( )
43+ const onError = spy ( )
4444 const stopLogging = BaseError . logProcess ( { onError } )
4545 const error = new BaseError ( 'test' )
4646 await createProcessError ( error )
8787 test . serial (
8888 `Process errors are normalized to ErrorClass | ${ title } ` ,
8989 async ( t ) => {
90- const onError = sinon . spy ( )
90+ const onError = spy ( )
9191 const stopLogging = ErrorClass . logProcess ( { onError } )
9292 await createProcessError ( error )
9393 t . is ( onError . args [ 0 ] [ 0 ] . constructor , expectedConstructor )
0 commit comments