Conversation
…ervices This PR introduces Jest testing infrastructure for apps/studio and adds comprehensive unit test coverage for services: - Configured Jest runner with Next.js integration and standard mocks - Added unit tests for SettingsService (covering get, set, isEqual) - Added unit tests for SpecificationService (covering specs, latestVersion, getSpec) - Added unit tests for ServerAPIService (covering retrieveProblem, generate) - Fixed test state isolation in NavigationService test suite - Enabled monorepo test execution via Turborepo (pnpm test) Fixes asyncapi#1246 Signed-off-by: SH20RAJ <shaswatraj3@gmail.com>
|
✅ Deploy Preview for asyncapi-studio-design-system ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for modest-rosalind-098b67 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|



Description
This PR addresses issue #1246 by configuring the Jest testing infrastructure for
apps/studioand adding unit test coverage for services that previously lacked tests.Changes Included:
Jest Testing Setup for
apps/studio:jest.config.jsandjest.setup.jswith Next.js integration and standard polyfills (TextEncoder,TextDecoder)."test": "jest"and"test:watch": "jest --watch"scripts toapps/studio/package.jsonenabling monorepo test execution via Turborepo (pnpm test).New Service Unit Tests Added:
SettingsService(settings.service.test.ts): Unit tests covering.get(),.set(), and.isEqual().SpecificationService(specification.service.test.ts): Unit tests covering.specs,.latestVersion, and.getSpec().ServerAPIService(server-api.service.test.ts): Unit tests covering.retrieveProblem()(200, 400, 500 status codes) and.generate().State Isolation in Existing Test Suites:
navigation.service.test.tsduring non-URL source transitions.Verification:
pnpm test: All 7 test suites passed (37/37 tests).pnpm lint: 0 errors / 0 warnings.pnpm build: 4/4 packages and apps built successfully.Fixes #1246