Skip to content

chore[PH-40]: unit tests setup with Vitest + CL1 tests#7

Draft
ancarofl wants to merge 20 commits intomainfrom
chore/PH-40_CL1_UT
Draft

chore[PH-40]: unit tests setup with Vitest + CL1 tests#7
ancarofl wants to merge 20 commits intomainfrom
chore/PH-40_CL1_UT

Conversation

@ancarofl
Copy link
Copy Markdown
Owner

No description provided.

Comment thread tests/api/provider/connection.test.ts Outdated
type: "error",
},
{
description: "undefined session id",
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining all this seems bad, I should reuse the errors I created but haven't found a nice way to do that yet

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ancarofl ancarofl force-pushed the chore/PH-40_CL1_UT branch from 5311cbe to 1273920 Compare August 1, 2025 19:50
},
];

describe("GET /api/[provider]/oauth", () => {
Copy link
Copy Markdown
Owner Author

@ancarofl ancarofl Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting - the test was working with the wrong route (not /oauth but /authorization) cuz it uses the imported route handler (at the top of the file), not what I type here. So it literally does not matter what I type here, which I find pretty strange. But ofc it makes sense cuz otherwise https://example.com wouldn't work right

The dynamic route params are passed directly (const params = { provider: provider as PlatformKey };). The query params in the URL are parsed and used by the handler. So those matter.

@ancarofl ancarofl changed the title chore[PH-40] unit tests setup with Vitest + CL1 tests chore[PH-40]: unit tests setup with Vitest + CL1 tests Aug 6, 2025
@marcel-tuinstra
Copy link
Copy Markdown

Looks good, I approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants