Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MetricsSockets' release lock test #11

Open
robb-j opened this issue Nov 5, 2021 · 0 comments
Open

Fix MetricsSockets' release lock test #11

robb-j opened this issue Nov 5, 2021 · 0 comments
Labels
tests Changes to a test or improving coverage

Comments

@robb-j
Copy link
Member

robb-j commented Nov 5, 2021

It stopped working because because cameOnline no longer awaits #triggerVisitors.

it('should release the lock', async () => {
  const { metrics, semaphore, sockets } = setup()
  mocked(sockets.getSocketsInRoom).mockResolvedValue([
    'socket-a',
    'socket-b',
    'socket-c',
  ])
  mocked(semaphore.aquire).mockResolvedValue(true)
  mocked(semaphore.hasLock).mockResolvedValue(true)

  await metrics.cameOnline('socket-a')

  expect(semaphore.release).toBeCalledWith('site_visitors')
})
@robb-j robb-j added the tests Changes to a test or improving coverage label Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Changes to a test or improving coverage
Projects
None yet
Development

No branches or pull requests

1 participant