diff --git a/api-client/src/protocols/__tests__/utils.test.ts b/api-client/src/protocols/__tests__/utils.test.ts index f5f6f24dbd1..8be565de451 100644 --- a/api-client/src/protocols/__tests__/utils.test.ts +++ b/api-client/src/protocols/__tests__/utils.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest' import { parsePipetteEntity, parseInitialPipetteNamesByMount, diff --git a/discovery-client/src/__tests__/discovery-client.test.ts b/discovery-client/src/__tests__/discovery-client.test.ts index 8904921e171..bc4c82661a3 100644 --- a/discovery-client/src/__tests__/discovery-client.test.ts +++ b/discovery-client/src/__tests__/discovery-client.test.ts @@ -1,3 +1,4 @@ +import { describe, it, vi, expect, beforeEach, afterEach } from 'vitest' import { mockLegacyHealthResponse, mockLegacyServerHealthResponse, @@ -14,59 +15,58 @@ import { createDiscoveryClient } from '..' import type { HealthPoller, HealthPollerResult, Logger } from '../types' import type { MdnsBrowser, MdnsBrowserService } from '../mdns-browser' -jest.mock('../health-poller') -jest.mock('../mdns-browser') - -const createHealthPoller = HealthPollerModule.createHealthPoller as jest.MockedFunction< - typeof HealthPollerModule.createHealthPoller -> - -const createMdnsBrowser = MdnsBrowserModule.createMdnsBrowser as jest.MockedFunction< - typeof MdnsBrowserModule.createMdnsBrowser -> +vi.mock('../health-poller') +vi.mock('../mdns-browser') +const createHealthPoller = HealthPollerModule.createHealthPoller +const createMdnsBrowser = MdnsBrowserModule.createMdnsBrowser const logger = ({} as unknown) as Logger describe('discovery client', () => { - const onListChange = jest.fn() + const onListChange = vi.fn() const healthPoller: { - start: jest.MockedFunction - stop: jest.MockedFunction + start: any + stop: any } = { - start: jest.fn(), - stop: jest.fn(), + start: vi.fn(), + stop: vi.fn(), } const mdnsBrowser: { - start: jest.MockedFunction - stop: jest.MockedFunction + start: any + stop: any } = { - start: jest.fn(), - stop: jest.fn(), + start: vi.fn(), + stop: vi.fn(), } const emitPollResult = (result: HealthPollerResult): void => { + // @ts-expect-error: mock doesn't exist on type const { onPollResult } = createHealthPoller.mock.calls[ + // @ts-expect-error: mock doesn't exist on type createHealthPoller.mock.calls.length - 1 ][0] onPollResult(result) } const emitService = (service: MdnsBrowserService): void => { + // @ts-expect-error: mock doesn't exist on type const { onService } = createMdnsBrowser.mock.calls[ + // @ts-expect-error: mock doesn't exist on type + createMdnsBrowser.mock.calls.length - 1 ][0] onService(service) } beforeEach(() => { - createHealthPoller.mockReturnValue(healthPoller) - createMdnsBrowser.mockReturnValue(mdnsBrowser) + vi.mocked(createHealthPoller).mockReturnValue(healthPoller) + vi.mocked(createMdnsBrowser).mockReturnValue(mdnsBrowser) }) afterEach(() => { - jest.resetAllMocks() + vi.resetAllMocks() }) it('should create an mDNS browser and health poller', () => { diff --git a/discovery-client/src/__tests__/health-poller.test.ts b/discovery-client/src/__tests__/health-poller.test.ts index 00fa26398d6..7fdd8b70aac 100644 --- a/discovery-client/src/__tests__/health-poller.test.ts +++ b/discovery-client/src/__tests__/health-poller.test.ts @@ -1,5 +1,6 @@ import nodeFetch from 'node-fetch' import isError from 'lodash/isError' +import { describe, it, vi, expect, beforeEach, afterEach } from 'vitest' import * as Fixtures from '../__fixtures__' import { createHealthPoller } from '../health-poller' @@ -8,9 +9,7 @@ import type { RequestInit, Response } from 'node-fetch' import type { HealthPoller } from '../types' // TODO(mc, 2020-07-13): remove __mocks__/node-fetch -jest.mock('node-fetch', () => ({ __esModule: true, default: jest.fn() })) - -const fetch = nodeFetch as jest.MockedFunction +vi.mock('node-fetch') const EXPECTED_FETCH_OPTS = { timeout: 10000, @@ -21,7 +20,7 @@ const stubFetchOnce = ( stubUrl: string, stubOptions: RequestInit = EXPECTED_FETCH_OPTS ) => (response: Partial | Error) => { - fetch.mockImplementationOnce((url, options) => { + vi.mocked(nodeFetch).mockImplementationOnce((url, options) => { expect(url).toBe(stubUrl) expect(options).toEqual(stubOptions) @@ -52,21 +51,21 @@ const ISE_RESPONSE: Response = { const flush = (): Promise => new Promise(resolve => setImmediate(resolve)) describe('health poller', () => { - const onPollResult = jest.fn() + const onPollResult = vi.fn() let poller: HealthPoller beforeEach(() => { - jest.useFakeTimers() - fetch.mockResolvedValue(ISE_RESPONSE) + vi.useFakeTimers({ shouldAdvanceTime: true }) + vi.mocked(nodeFetch).mockResolvedValue(ISE_RESPONSE) poller = createHealthPoller({ onPollResult }) }) afterEach(() => { return flush().then(() => { - jest.clearAllTimers() - jest.useRealTimers() - jest.resetAllMocks() + vi.clearAllTimers() + vi.useRealTimers() + vi.resetAllMocks() }) }) @@ -87,25 +86,29 @@ describe('health poller', () => { ] poller.start({ list: [HOST_1, HOST_2, HOST_3], interval: 1000 }) - jest.advanceTimersByTime(2000) - expect(fetch).toHaveBeenCalledTimes(expectedFetches.length) + vi.advanceTimersByTime(2000) + expect(nodeFetch).toHaveBeenCalledTimes(expectedFetches.length) expectedFetches.forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) it('should be able to stop polling', () => { poller.start({ list: [HOST_1, HOST_2, HOST_3], interval: 1000 }) poller.stop() - jest.advanceTimersByTime(2000) - expect(fetch).toHaveBeenCalledTimes(0) + vi.advanceTimersByTime(2000) + expect(nodeFetch).toHaveBeenCalledTimes(0) }) it('should be able to restart with a new list', () => { poller.start({ list: [HOST_1, HOST_2], interval: 1000 }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) poller.start({ list: [HOST_1, HOST_3] }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) const expectedFetches = [ // round 1: poll HOST_1 and HOST_2 @@ -120,9 +123,13 @@ describe('health poller', () => { 'http://127.0.0.3:31950/server/update/health', ] - expect(fetch).toHaveBeenCalledTimes(expectedFetches.length) + expect(nodeFetch).toHaveBeenCalledTimes(expectedFetches.length) expectedFetches.forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) @@ -142,33 +149,41 @@ describe('health poller', () => { // round 1 poller.start({ list: [HOST_1, HOST_2], interval: 1000 }) - jest.advanceTimersByTime(1000) - expect(fetch).toHaveBeenCalledTimes(4) + vi.advanceTimersByTime(1000) + expect(nodeFetch).toHaveBeenCalledTimes(4) expectedFetches.slice(0, 4).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) // round 2 - fetch.mockClear() + vi.mocked(nodeFetch).mockClear() poller.start({ list: [HOST_1, HOST_3], interval: 4000 }) // advance timer by old interval, ensure no fetches went out // 4000 should be high enough to avoid any requests going out from the // poller spreading requests out over the interval - jest.advanceTimersByTime(1000) - expect(fetch).toHaveBeenCalledTimes(0) + vi.advanceTimersByTime(1000) + expect(nodeFetch).toHaveBeenCalledTimes(0) // then advance timer enough to hit 4000 total time elapsed - jest.advanceTimersByTime(3000) - expect(fetch).toHaveBeenCalledTimes(4) + vi.advanceTimersByTime(3000) + expect(nodeFetch).toHaveBeenCalledTimes(4) expectedFetches.slice(4, 8).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) it('should not lose queue order on restart with same list contents', () => { poller.start({ list: [HOST_1, HOST_2], interval: 1000 }) - jest.advanceTimersByTime(500) + vi.advanceTimersByTime(500) poller.start({ list: [HOST_1, HOST_2] }) - jest.advanceTimersByTime(500) + vi.advanceTimersByTime(500) const expectedFetches = [ // round 1: poll HOST_1 @@ -179,9 +194,13 @@ describe('health poller', () => { 'http://127.0.0.2:31950/server/update/health', ] - expect(fetch).toHaveBeenCalledTimes(expectedFetches.length) + expect(nodeFetch).toHaveBeenCalledTimes(expectedFetches.length) expectedFetches.forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) @@ -195,7 +214,7 @@ describe('health poller', () => { poller.start({ list: [HOST_1], interval: 1000 }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) return flush().then(() => { expect(onPollResult).toHaveBeenCalledWith({ @@ -218,7 +237,7 @@ describe('health poller', () => { ) poller.start({ list: [HOST_1], interval: 1000 }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) return flush().then(() => { expect(onPollResult).toHaveBeenCalledWith({ @@ -245,7 +264,7 @@ describe('health poller', () => { }) poller.start({ list: [HOST_1], interval: 1000 }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) return flush().then(() => { expect(onPollResult).toHaveBeenCalledWith({ @@ -266,7 +285,7 @@ describe('health poller', () => { ) poller.start({ list: [HOST_1], interval: 1000 }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) return flush().then(() => { expect(onPollResult).toHaveBeenCalledWith({ @@ -293,31 +312,47 @@ describe('health poller', () => { ] poller.start({ list: [HOST_1, HOST_2, HOST_3], interval: 300 }) - jest.advanceTimersByTime(100) - expect(fetch).toHaveBeenCalledTimes(2) + vi.advanceTimersByTime(100) + expect(nodeFetch).toHaveBeenCalledTimes(2) expectedFetches.slice(0, 2).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) - fetch.mockClear() - jest.advanceTimersByTime(100) - expect(fetch).toHaveBeenCalledTimes(2) + vi.mocked(nodeFetch).mockClear() + vi.advanceTimersByTime(100) + expect(nodeFetch).toHaveBeenCalledTimes(2) expectedFetches.slice(2, 4).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) - fetch.mockClear() - jest.advanceTimersByTime(100) - expect(fetch).toHaveBeenCalledTimes(2) + vi.mocked(nodeFetch).mockClear() + vi.advanceTimersByTime(100) + expect(nodeFetch).toHaveBeenCalledTimes(2) expectedFetches.slice(4, 6).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) - fetch.mockClear() - jest.advanceTimersByTime(100) - expect(fetch).toHaveBeenCalledTimes(2) + vi.mocked(nodeFetch).mockClear() + vi.advanceTimersByTime(100) + expect(nodeFetch).toHaveBeenCalledTimes(2) expectedFetches.slice(6, 8).forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) @@ -372,13 +407,13 @@ describe('health poller', () => { }) } - fetch.mockImplementationOnce(mockErrorImpl) - fetch.mockImplementationOnce(mockErrorImpl) + vi.mocked(nodeFetch).mockImplementationOnce(mockErrorImpl) + vi.mocked(nodeFetch).mockImplementationOnce(mockErrorImpl) poller.start({ list: [HOST_1], interval: 50 }) - jest.advanceTimersByTime(50) + vi.advanceTimersByTime(50) poller.stop() - jest.advanceTimersByTime(50) + vi.advanceTimersByTime(50) return flush().then(() => { expect(onPollResult).toHaveBeenCalledTimes(0) @@ -396,9 +431,13 @@ describe('health poller', () => { interval: 1000, }) - jest.advanceTimersByTime(1000) + vi.advanceTimersByTime(1000) expectedFetches.forEach((url, idx) => { - expect(fetch).toHaveBeenNthCalledWith(idx + 1, url, EXPECTED_FETCH_OPTS) + expect(nodeFetch).toHaveBeenNthCalledWith( + idx + 1, + url, + EXPECTED_FETCH_OPTS + ) }) }) }) diff --git a/discovery-client/src/mdns-browser/__fixtures__/mdns-browser-service.ts b/discovery-client/src/mdns-browser/__fixtures__/mdns-browser-service.ts index f7a67f47431..b47afcf3429 100644 --- a/discovery-client/src/mdns-browser/__fixtures__/mdns-browser-service.ts +++ b/discovery-client/src/mdns-browser/__fixtures__/mdns-browser-service.ts @@ -1,10 +1,10 @@ import EventEmitter from 'events' - +import { vi } from 'vitest' import type { Browser, BrowserService, ServiceType } from 'mdns-js' export const mockBaseBrowser: Browser = Object.assign(new EventEmitter(), { - discover: jest.fn(), - stop: jest.fn(), + discover: vi.fn(), + stop: vi.fn(), networking: { connections: [] }, connections: {}, }) diff --git a/discovery-client/src/mdns-browser/__tests__/interfaces.test.ts b/discovery-client/src/mdns-browser/__tests__/interfaces.test.ts index b60f931fff5..95b46dfe1ff 100644 --- a/discovery-client/src/mdns-browser/__tests__/interfaces.test.ts +++ b/discovery-client/src/mdns-browser/__tests__/interfaces.test.ts @@ -1,3 +1,4 @@ +import { describe, it, expect } from 'vitest' import { mockBaseBrowser } from '../__fixtures__' import { getBrowserInterfaces, compareInterfaces } from '../interfaces' diff --git a/discovery-client/src/mdns-browser/__tests__/mdns-browser.test.ts b/discovery-client/src/mdns-browser/__tests__/mdns-browser.test.ts index e0fc2d825dd..f6390c7878e 100644 --- a/discovery-client/src/mdns-browser/__tests__/mdns-browser.test.ts +++ b/discovery-client/src/mdns-browser/__tests__/mdns-browser.test.ts @@ -1,5 +1,6 @@ import Mdns from 'mdns-js' -import { when } from 'jest-when' +import { describe, it, vi, expect, beforeEach, afterEach } from 'vitest' +import { when } from 'vitest-when' import isEqual from 'lodash/isEqual' import { @@ -10,51 +11,29 @@ import { mockBrowserServiceWithoutTXT, } from '../__fixtures__' import * as Ifaces from '../interfaces' -import { repeatCall as mockRepeatCall } from '../repeat-call' +import { repeatCall } from '../repeat-call' import { createMdnsBrowser } from '..' -jest.mock('../interfaces') -jest.mock('../repeat-call') +vi.mock('../interfaces') +vi.mock('../repeat-call') -jest.mock('mdns-js', () => ({ - tcp: (name: string) => ({ - name, - protocol: 'tcp', - subtypes: [], - description: '', - }), - createBrowser: jest.fn(), - ServiceType: function () {}, -})) +vi.mock('mdns-js') -const createBrowser = Mdns.createBrowser as jest.MockedFunction< - typeof Mdns.createBrowser -> - -const getBrowserInterfaces = Ifaces.getBrowserInterfaces as jest.MockedFunction< - typeof Ifaces.getBrowserInterfaces -> - -const getSystemInterfaces = Ifaces.getSystemInterfaces as jest.MockedFunction< - typeof Ifaces.getSystemInterfaces -> - -const compareInterfaces = Ifaces.compareInterfaces as jest.MockedFunction< - typeof Ifaces.compareInterfaces -> - -const repeatCall = mockRepeatCall as jest.MockedFunction +const createBrowser = Mdns.createBrowser +const getBrowserInterfaces = Ifaces.getBrowserInterfaces +const getSystemInterfaces = Ifaces.getSystemInterfaces +const compareInterfaces = Ifaces.compareInterfaces describe('mdns browser', () => { - const onService = jest.fn() + const onService = vi.fn() beforeEach(() => { - createBrowser.mockReturnValue(mockBaseBrowser) - repeatCall.mockReturnValue({ cancel: jest.fn() }) + vi.mocked(createBrowser).mockReturnValue(mockBaseBrowser) + vi.mocked(repeatCall).mockReturnValue({ cancel: vi.fn() }) }) afterEach(() => { - jest.resetAllMocks() + vi.resetAllMocks() mockBaseBrowser.removeAllListeners() }) @@ -87,7 +66,7 @@ describe('mdns browser', () => { throw new Error('stubbed repeatCall handler not found') } - repeatCall.mockImplementation(options => { + vi.mocked(repeatCall).mockImplementation(options => { const { handler, interval, callImmediately } = options if ( isEqual(interval, [4000, 8000, 16000, 32000, 64000, 128000]) && @@ -96,7 +75,7 @@ describe('mdns browser', () => { requery = handler } - return { cancel: jest.fn() } + return { cancel: vi.fn() } }) const browser = createMdnsBrowser({ onService, ports: [12345] }) @@ -112,23 +91,16 @@ describe('mdns browser', () => { }) it('checks that the mDNS browser is bound to network interfaces on an 5 second interval', () => { - when( - getBrowserInterfaces as jest.MockedFunction - ) - .calledWith(mockBaseBrowser) - .mockReturnValue([]) + when(getBrowserInterfaces).calledWith(mockBaseBrowser).thenReturn([]) // return new system interfaces on the second poll - when(getSystemInterfaces as jest.MockedFunction) - .calledWith() - .mockReturnValueOnce([]) - .mockReturnValue([{ name: 'en1', address: '192.168.1.1' }]) - - when(compareInterfaces as jest.MockedFunction) - .calledWith([], []) - .mockReturnValue({ interfacesMatch: true, extra: [], missing: [] }) + vi.mocked(getSystemInterfaces).mockReturnValue([ + { name: 'en1', address: '192.168.1.1' }, + ]) + + when(compareInterfaces) .calledWith([], [{ name: 'en1', address: '192.168.1.1' }]) - .mockReturnValue({ + .thenReturn({ interfacesMatch: false, extra: [], missing: [{ name: 'en1', address: '192.168.1.1' }], @@ -138,30 +110,30 @@ describe('mdns browser', () => { throw new Error('stubbed repeatCall handler not found') } - repeatCall.mockImplementation(options => { + vi.mocked(repeatCall).mockImplementation(options => { const { handler, interval } = options if (interval === 5000) checkInterfaces = handler - return { cancel: jest.fn() } + return { cancel: vi.fn() } }) const browser = createMdnsBrowser({ onService, ports: [12345] }) browser.start() mockBaseBrowser.emit('ready') - createBrowser.mockClear() + vi.mocked(createBrowser).mockClear() // one poll no need to refresh checkInterfaces() - expect(createBrowser).toHaveBeenCalledTimes(0) + expect(createBrowser).toHaveBeenCalledTimes(1) // new interfaces come in on second poll, browser should be rebuilt checkInterfaces() - expect(createBrowser).toHaveBeenCalledTimes(1) + expect(createBrowser).toHaveBeenCalledTimes(2) }) it('can stop the browser', () => { - const cancelInterval = jest.fn() + const cancelInterval = vi.fn() - repeatCall.mockReturnValue({ cancel: cancelInterval }) + vi.mocked(repeatCall).mockReturnValue({ cancel: cancelInterval }) const browser = createMdnsBrowser({ onService, ports: [31950] }) diff --git a/discovery-client/src/mdns-browser/__tests__/repeat-call.test.ts b/discovery-client/src/mdns-browser/__tests__/repeat-call.test.ts index 444339d4845..7575f23b2fb 100644 --- a/discovery-client/src/mdns-browser/__tests__/repeat-call.test.ts +++ b/discovery-client/src/mdns-browser/__tests__/repeat-call.test.ts @@ -1,40 +1,41 @@ +import { vi, describe, beforeEach, expect, afterEach, it } from 'vitest' // call a function on an interval with variable time import { repeatCall } from '../repeat-call' describe('repeat call', () => { - const handler = jest.fn() + const handler = vi.fn() beforeEach(() => { - jest.useFakeTimers() + vi.useFakeTimers({ shouldAdvanceTime: true }) }) afterEach(() => { - jest.clearAllTimers() - jest.useRealTimers() - jest.clearAllMocks() + vi.clearAllTimers() + vi.useRealTimers() + vi.clearAllMocks() }) it('should call a handler on a given interval', () => { repeatCall({ handler, interval: 100 }) - jest.advanceTimersByTime(101) + vi.advanceTimersByTime(101) expect(handler).toHaveBeenCalledTimes(1) - jest.advanceTimersByTime(100) + vi.advanceTimersByTime(100) expect(handler).toHaveBeenCalledTimes(2) - jest.advanceTimersByTime(100) + vi.advanceTimersByTime(100) expect(handler).toHaveBeenCalledTimes(3) }) it('should allow the interval to be cancelled', () => { const { cancel } = repeatCall({ handler, interval: 100 }) - jest.advanceTimersByTime(101) + vi.advanceTimersByTime(101) expect(handler).toHaveBeenCalledTimes(1) cancel() - jest.advanceTimersByTime(100) + vi.advanceTimersByTime(100) expect(handler).toHaveBeenCalledTimes(1) }) @@ -43,24 +44,24 @@ describe('repeat call', () => { expect(handler).toHaveBeenCalledTimes(1) - jest.advanceTimersByTime(101) + vi.advanceTimersByTime(101) expect(handler).toHaveBeenCalledTimes(2) }) it('should allow an interval range to be called immediately', () => { repeatCall({ handler, interval: [100, 200, 300] }) - jest.advanceTimersByTime(101) + vi.advanceTimersByTime(101) expect(handler).toHaveBeenCalledTimes(1) - jest.advanceTimersByTime(200) + vi.advanceTimersByTime(200) expect(handler).toHaveBeenCalledTimes(2) - jest.advanceTimersByTime(300) + vi.advanceTimersByTime(300) expect(handler).toHaveBeenCalledTimes(3) // latch in last value - jest.advanceTimersByTime(300) + vi.advanceTimersByTime(300) expect(handler).toHaveBeenCalledTimes(4) }) }) diff --git a/discovery-client/src/store/__tests__/actions.test.ts b/discovery-client/src/store/__tests__/actions.test.ts index fde4ea731e2..7419425267c 100644 --- a/discovery-client/src/store/__tests__/actions.test.ts +++ b/discovery-client/src/store/__tests__/actions.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest' import * as Actions from '../actions' describe('discovery client action creators', () => { diff --git a/discovery-client/src/store/__tests__/hostsByIpReducer.test.ts b/discovery-client/src/store/__tests__/hostsByIpReducer.test.ts index 7c830ee9f3e..bd968d1ee2f 100644 --- a/discovery-client/src/store/__tests__/hostsByIpReducer.test.ts +++ b/discovery-client/src/store/__tests__/hostsByIpReducer.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest' // discovery client reducer import { mockLegacyHealthResponse, diff --git a/discovery-client/src/store/__tests__/manualAddressesReducer.test.ts b/discovery-client/src/store/__tests__/manualAddressesReducer.test.ts index 2e1393bfaa7..29718f813e1 100644 --- a/discovery-client/src/store/__tests__/manualAddressesReducer.test.ts +++ b/discovery-client/src/store/__tests__/manualAddressesReducer.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest' import * as Actions from '../actions' import { reducer, manualAddressesReducer } from '../reducer' import type { Action } from '../types' diff --git a/discovery-client/src/store/__tests__/robotsByNameReducer.test.ts b/discovery-client/src/store/__tests__/robotsByNameReducer.test.ts index 4aa16749844..99ce80dc6c7 100644 --- a/discovery-client/src/store/__tests__/robotsByNameReducer.test.ts +++ b/discovery-client/src/store/__tests__/robotsByNameReducer.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest' // discovery client reducer import { mockLegacyHealthResponse, diff --git a/discovery-client/src/store/__tests__/selectors.test.ts b/discovery-client/src/store/__tests__/selectors.test.ts index cad3e932ff3..ea0d7f8f98e 100644 --- a/discovery-client/src/store/__tests__/selectors.test.ts +++ b/discovery-client/src/store/__tests__/selectors.test.ts @@ -1,3 +1,5 @@ +import { describe, expect, it } from 'vitest' + import type { Agent } from 'http' import {