Skip to content

Commit 8d9f826

Browse files
Clean up
1 parent 5038c2f commit 8d9f826

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/src/tests-batchUploader_3.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,27 +147,27 @@ describe('batch uploader', () => {
147147
});
148148
});
149149

150-
it('should return pending uploads if a 500 is returned', function(done) {
150+
it('should return pending uploads if a 500 is returned', async function() {
151151
window.mParticle._resetForTests(MPConfig);
152152

153153
fetchMock.post(urls.events, 500);
154154

155155
window.mParticle.init(apiKey, window.mParticle.config);
156-
waitForCondition(hasIdentifyReturned)
157-
.then(() => {
156+
await waitForCondition(hasIdentifyReturned);
157+
158158
window.mParticle.logEvent('Test Event');
159159

160160
let pendingEvents = window.mParticle.getInstance()._APIClient.uploader.eventsQueuedForProcessing;
161161

162-
pendingEvents.length.should.equal(3)
162+
pendingEvents.length.should.equal(3);
163163
pendingEvents[0].EventName.should.equal(1);
164164
pendingEvents[1].EventName.should.equal(10);
165165
pendingEvents[2].EventName.should.equal('Test Event');
166166

167167
fetchMock.post(urls.events, 200);
168168

169169
// First fetch call is an identify call
170-
(fetchMock.lastCall()[0].endsWith('identify')).should.equal(true)
170+
(fetchMock.lastCall()[0].endsWith('identify')).should.equal(true);
171171
window.mParticle.upload();
172172

173173
let nowPendingEvents = window.mParticle.getInstance()._APIClient.uploader.eventsQueuedForProcessing;
@@ -178,9 +178,6 @@ describe('batch uploader', () => {
178178
batch.events[1].event_type.should.equal('application_state_transition');
179179
batch.events[2].event_type.should.equal('custom_event');
180180
batch.events[2].data.event_name.should.equal('Test Event');
181-
182-
done();
183-
})
184181
});
185182

186183
it('should send source_message_id with events to v3 endpoint', function(done) {

0 commit comments

Comments
 (0)