Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix handling of promises in tests #53

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions plugins/notifications-backend/src/service/handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,9 @@ describe('handlers', () => {
{},
);

const setReadPromises: Promise<void>[] = [];

resultGet.forEach(async notification => {
setReadPromises.push(
setRead(dbClient, catalogUser, notification.id, true),
);
});

const setReadPromises: Promise<void>[] = resultGet.map(notification =>
setRead(dbClient, catalogUser, notification.id, true),
);
await Promise.all(setReadPromises);

const resultGetRead = await getNotifications(
Expand Down
5 changes: 1 addition & 4 deletions plugins/notifications-frontend/src/openapi/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
* Do not edit the class manually.
*/

export const BASE_PATH = 'http://localhost:7007/api/notifications'.replace(
/\/+$/,
'',
);
export const BASE_PATH = 'http://localhost:7007/api/notifications';

export interface ConfigurationParameters {
basePath?: string; // override base path
Expand Down