Skip to content

Commit ef92829

Browse files
committed
feat: add support for listing drivers in default channel
1 parent dc7f866 commit ef92829

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/endpoint/drivers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ export class DriversEndpoint extends Endpoint {
213213
return this.client.getPagedItems('')
214214
}
215215

216+
/**
217+
* List drivers in the default channel. (The default channel in this context is a channel
218+
* that users do not need to subscribe to.)
219+
*/
220+
public async listDefault(): Promise<EdgeDriverSummary[]> {
221+
return this.client.getPagedItems('default')
222+
}
223+
216224
/**
217225
* Uploads the zipped package represented by archiveData.
218226
*/

test/unit/drivers.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ describe('DriversEndpoint', () => {
5050
expect(getPagedItemsSpy).toHaveBeenCalledWith('')
5151
})
5252

53+
test('listDefault', async () => {
54+
const drivers = [{ driverId: 'listed-in-channel-id' }] as EdgeDriverSummary[]
55+
getPagedItemsSpy.mockResolvedValueOnce(drivers)
56+
57+
expect(await driversEndpoint.listDefault()).toBe(drivers)
58+
59+
expect(getPagedItemsSpy).toHaveBeenCalledWith('default')
60+
})
61+
5362
test('upload', async () => {
5463
const driver = { driverId: 'driver-id' }
5564
requestSpy.mockResolvedValueOnce(driver)

0 commit comments

Comments
 (0)