Skip to content

Commit a4d3d93

Browse files
committed
Fix unit tests
Updates the unit tests so that async/await is not used with the 'done' callback. Also aligns the tests for the callback client to only use the 'done' callback-style tests rather than promises, which clarifies the usage of the client.
1 parent 06fafcf commit a4d3d93

2 files changed

Lines changed: 180 additions & 182 deletions

File tree

src/v1-promise.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,10 @@ describe('Experimental Service', () => {
476476
});
477477

478478
await client.writeSchema(request);
479-
480479
client.close();
481480
});
482481

483-
it('can bulk import relationships', async (done) => {
482+
it('can bulk import relationships', () => {
484483
const { promises: client } = NewClient(
485484
token,
486485
'localhost:50051',
@@ -489,11 +488,14 @@ describe('Experimental Service', () => {
489488

490489
const writeStream = client.bulkImportRelationships((err, value) => {
491490
if (err) {
492-
done.fail(err);
491+
fail(err);
493492
}
494493

495494
expect(value?.numLoaded).toEqual('2');
496-
done();
495+
});
496+
497+
writeStream.on('error', (e) => {
498+
fail(e);
497499
});
498500

499501
const resource = ObjectReference.create({

0 commit comments

Comments
 (0)