Introduce Testing Plan and Implement Runtime Module Tests for NodeJs - #88
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive testing framework for the Agent365-nodejs SDK, implementing unit tests for runtime modules and reorganizing the test infrastructure. The changes establish a foundation for systematic testing across all SDK packages, with clear documentation and tooling.
Key Changes
- New Jest Configuration: Migrated from JSON to CommonJS configuration (
jest.config.cjs) with comprehensive coverage settings and module name mapping - Runtime Module Tests: Added complete test suites for
utility,power-platform-api-discovery,environment-utils, andagentic-authorization-service - Import Path Migration: Updated observability tests to import from source (
src/) rather than built (dist/cjs/) paths for consistency
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/jest.config.cjs |
New comprehensive Jest configuration with module mapping, coverage settings, and CommonJS format |
tests/jest.config.json |
Removed old JSON configuration in favor of CommonJS |
tests/tsconfig.json |
Removed rootDir constraint and added ../packages/*/src/**/* to include to support source imports |
tests/package.json |
Updated package name, description, and test scripts to reference new jest.config.cjs |
tests/runtime/utility.test.ts |
New comprehensive tests for GetAppIdFromToken and ResolveAgentIdentity functions |
tests/runtime/power-platform-api-discovery.test.ts |
New tests covering cluster categories, token audiences, and endpoint generation |
tests/runtime/environment-utils.test.ts |
New tests for environment utilities including cluster categories and authentication scopes |
tests/runtime/agentic-authorization-service.test.ts |
New tests for agentic authentication token exchange |
tests/observability/core/scopes.test.ts |
Updated imports from dist paths to src paths using package exports |
tests/observability/core/observabilityBuilder-options.test.ts |
Migrated imports to src paths and updated mock paths |
tests/observability/core/SpanProcessor.test.ts |
Updated imports to use src paths consistently |
tests/observability/core/BaggageBuilder.test.ts |
Migrated imports to src paths |
tests/observability/extension/openai/OpenAIAgentsTraceInstrumentor.test.ts |
Added explicit enable() call with improved comment clarity |
tests/common/power-platform-api-discovery.test.ts |
Removed (tests moved to tests/runtime directory) |
tests/TEST_PLAN.md |
New comprehensive testing strategy and implementation roadmap documentation |
tests/RUNNING_TESTS.md |
New guide for running tests, generating coverage, and troubleshooting |
tests/README.md |
New overview documentation for the test suite |
package.json |
Added test:coverage script (references incorrect config file) |
pontemonti
previously approved these changes
Dec 4, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nto users/mrunalhirve/NodeJsUnitTests
pontemonti
approved these changes
Dec 5, 2025
fpfp100
approved these changes
Dec 5, 2025
juliomenendez
approved these changes
Dec 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix coverage
