Skip to content

Commit

Permalink
apply requested changes to adapter spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffone17 committed Oct 30, 2024
1 parent a2f4c92 commit a49a807
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('waitDevice', () => {
})

test('clear intervals and timeouts after fail', async () => {
jest.useFakeTimers('legacy')
jest.useFakeTimers()

const adapter = new Adapter(dbus, 'hci0')

Expand All @@ -158,11 +158,11 @@ describe('waitDevice', () => {
const discoveryInterval = 100

const spyClearInterval = jest.spyOn(global, 'clearInterval')
const spyClearTimeout = jest.spyOn(global, 'clearInterval')
const spyClearTimeout = jest.spyOn(global, 'clearTimeout')

const waitDevicePromise = adapter.waitDevice('44:44:44:44:44:44', timeout, discoveryInterval)

jest.advanceTimersByTime(500)
jest.advanceTimersByTime(timeout)

await expect(waitDevicePromise).rejects.toThrow('operation timed out')

Expand Down

0 comments on commit a49a807

Please sign in to comment.