fix: restore typed emit() on ClassifierSdk; update smoke test comments#151
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the test suite to stop requesting explicit OAuth scope values, switching functional tests to pass an audience parsed via parseAudience, and extends functional tests to configure the SDK’s gRPC endpoint via grpcAddress.
Changes:
- Remove
scopefrom unit and functional test authentication configurations; update the auth manager unit test mock expectation accordingly. - Update functional tests to set
audience: parseAudience(process.env.VITE_ATHENA_AUDIENCE)and passgrpcAddressfromVITE_ATHENA_GRPC_ADDRESS. - Fix a functional test assertion to correctly verify
response.classificationsis an array.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/module-import.test.ts | Removes scope from the SDK instantiation used for import/creation verification. |
| tests/unit/main.test.ts | Removes scope from several ClassifierSdk constructor tests. |
| tests/unit/authenticationManager.test.ts | Removes scope from options and updates the clientCredentialsGrant expectation to match the no-scope call shape. |
| tests/functional/main.functional.test.ts | Switches functional tests to audience via parseAudience, adds grpcAddress, and fixes an assertion on classifications. |
| tests/functional/e2e.functional.test.ts | Removes scope from E2E test authentication config (audience remains). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Dunno what yo udid the break the build but it seems unrelated to the changes in this PR. |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/crispthinking/athena-nodejs-client/sessions/23f71223-381c-4f55-ad6f-1f2fcb4d9846 Co-authored-by: corpo-iwillspeak <265613520+corpo-iwillspeak@users.noreply.github.com>
Updated all three smoke test comments in |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/crispthinking/athena-nodejs-client/sessions/bb87fd37-f79a-4ab4-9bb2-92e6165b65ea Co-authored-by: corpo-iwillspeak <265613520+corpo-iwillspeak@users.noreply.github.com>
Head branch was pushed to by a user without write access
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Switching
ClassifierSdkfromTypedEventEmitter<ClassifierEvents>to plainEventEmitterleftemit()untyped (emit(string | symbol, ...any[])), whileon/once/offalready had typed overrides. Smoke test comments still hardcodedlocalhost:50051aftergrpcAddresswas made configurable viaVITE_ATHENA_GRPC_ADDRESS.Changes
src/index.ts— adds a typedemitoverride matching the existingon/once/offpattern, restoring full public API type-safety without reintroducing theTypedEventEmittercast that broke the release build:__tests__/functional/main.functional.test.ts— replaces hardcodedlocalhost:50051references in smoke test setup comments with accurate guidance: address comes fromVITE_ATHENA_GRPC_ADDRESS, falling back to the SDK default.