Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(node): add unit tests to node sdk #206

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

Open
Lakshan-Chamoditha-Perera wants to merge 1 commit into asgardeo:main
base: main
Choose a base branch
Loading
from Lakshan-Chamoditha-Perera:node-unit-test

Conversation

@Lakshan-Chamoditha-Perera
Copy link

@Lakshan-Chamoditha-Perera Lakshan-Chamoditha-Perera commented Oct 13, 2025

Purpose

This PR introduces unit tests for the Node SDK to improve code reliability and maintainability.
The tests are implemented using Jest and cover core functionalities such as cookie configuration, session ID generation, and helper utilities.

Key Additions:

  • Added Jest configuration file (jest.config.js) and test-specific TypeScript config (tsconfig.spec.json).
  • Introduced unit tests under packages/node/src/__tests__/, including:
    • constants/CookieConfig.test.ts
    • fixtures/cookieOptions.ts
    • helpers/mockHelpers.ts
    • utils/generateSessionId.test.ts
    • utils/getSessionCookieOptions.test.ts
  • Updated package.json to include Jest dependencies and test scripts.

Copy link

⚠️ No Changeset found

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.

If these changes should result in a version bump, you need to add a changeset.

Refer Release Documentation to learn how to add a changeset.

Copy link
Member

@brionmario brionmario Oct 20, 2025

Choose a reason for hiding this comment

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

We use vitest instead of Jest.
Lets utilize that instead.
https://github.com/asgardeo/javascript/blob/52d5d7b987856e4896ea61f58d8d0f37115c82f8/packages/node/vitest.config.ts

Copy link
Member

@brionmario brionmario Oct 24, 2025

Choose a reason for hiding this comment

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

Please also check the Build failure and the Type Check.

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

Reviewers

@brionmario brionmario brionmario left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /