Skip to content

Conversation

@Lakshan-Chamoditha-Perera

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.

@asgardeo-github-bot
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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants