-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Topics / k1ch / Introduce Admin API:
GET /clients
(#119)
* chore: remove PGPool from db layer admin-client * feat: db layer / introduce getClients * feat: introduce GET /clients * chore: remove unused file and minor clean up * chore: bump version to 2.2.0 * chore: minor clean ups
- Loading branch information
Showing
11 changed files
with
151 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const assert = require('node:assert') | ||
const { describe, it } = require('mocha') | ||
const { usherDb } = require('../layer/knex') | ||
const adminClients = require('../layer/admin-client') | ||
|
||
describe('Admin client view', () => { | ||
describe('Test getClients', () => { | ||
it('Should return all the clients', async () => { | ||
const { count: totalCount } = await usherDb('clients').count('*').first() | ||
const clients = await adminClients.getClients() | ||
assert.equal(clients.length, Number(totalCount)) | ||
}) | ||
|
||
it('Returned clients should include all the table columns', async () => { | ||
const columns = Object.keys(await usherDb('clients').columnInfo()) | ||
const [client] = await adminClients.getClients() | ||
assert.ok(columns.every((col) => col in client)) | ||
}) | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters