Skip to content

Commit 7d0912d

Browse files
committed
Fix linting
1 parent 9f7948c commit 7d0912d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/events.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import test from 'ava'
2-
import sinon from 'sinon'
2+
import { spy } from 'sinon'
33
import { each } from 'test-each'
44

55
import { getConsoleStub } from './helpers/console.test.js'
@@ -31,7 +31,7 @@ each(EVENTS, ({ title }, eventName) => {
3131
return t.pass()
3232
}
3333

34-
const onError = sinon.spy()
34+
const onError = spy()
3535
const testError = new Error('test')
3636
const { stopLogging } = startLogging({
3737
onError: (...args) => {

src/helpers/console.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import sinon from 'sinon'
1+
import { stub } from 'sinon'
22

33
// Spy on `console.error()`
44
// eslint-disable-next-line no-restricted-globals
5-
export const getConsoleStub = () => sinon.stub(console, 'error')
5+
export const getConsoleStub = () => stub(console, 'error')

src/helpers/exit.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import process from 'node:process'
22

33
import fakeTimers from '@sinonjs/fake-timers'
4-
import sinon from 'sinon'
4+
import { stub } from 'sinon'
55

66
import { setProcessEvent, unsetProcessEvent } from './process.test.js'
77
import { startLogging } from './start.test.js'
@@ -39,7 +39,7 @@ const stopClockLogging = (stopLogging, clock) => {
3939

4040
// Start logging and stub `process.exit()`
4141
export const startExitLogging = (opts) => {
42-
sinon.stub(process, 'exit')
42+
stub(process, 'exit')
4343
const { stopLogging } = startLogging(opts)
4444
return stopExitLogging.bind(undefined, stopLogging)
4545
}

src/helpers/process.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import process from 'node:process'
22

3-
import sinon from 'sinon'
3+
import { spy } from 'sinon'
44

55
// Spy on process event handlers
66
export const setProcessEvent = (eventName) => {
7-
const processHandler = sinon.spy()
7+
const processHandler = spy()
88
process.on(eventName, processHandler)
99
return processHandler
1010
}

src/helpers/start.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import logProcessErrors from 'log-process-errors'
2-
import sinon from 'sinon'
2+
import { spy } from 'sinon'
33

44
export const startLogging = (opts) => {
5-
const onError = sinon.spy()
5+
const onError = spy()
66
const stopLogging = logProcessErrors({ onError, exit: false, ...opts })
77
return { onError, stopLogging }
88
}

0 commit comments

Comments
 (0)