Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Sep 19, 2024
1 parent cbff5d9 commit 2f04745
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/unit/harvester.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { EventEmitter } = require('node:events')
const sinon = require('sinon')

const { match } = require('../lib/custom-assertions')
const promiseResolvers = require('../lib/promise-resolvers')
const Harvester = require('../../lib/harvester')

class FakeAggregator extends EventEmitter {
Expand All @@ -35,7 +36,7 @@ function createAggregator(sandbox, opts) {
sandbox.stub(aggregator, 'start')
sandbox.stub(aggregator, 'stop')
sandbox.stub(aggregator, 'reconfigure')
sandbox.stub(aggregator, 'send')
sandbox.spy(aggregator, 'send')
return aggregator
}

Expand Down Expand Up @@ -94,9 +95,12 @@ test('should reconfigure all aggregators', (t) => {
})

test('resolve when all data is sent', async (t) => {
const { promise, resolve } = promiseResolvers()
const { aggregators, harvester } = t.nr
await harvester.clear(() => {
assert.equal(aggregators[0].send.callCount, 1, 'should call send on enabled aggregator')
assert.equal(aggregators[1].send.callCount, 0, 'should not call send on disabled aggregator')
resolve()
})
await promise
})

0 comments on commit 2f04745

Please sign in to comment.