Skip to content

Refactor unit tests#286

Merged
vladimir-rangelov merged 2 commits intonext-bidirectionalfrom
ci/refactor-unit-tests
Jan 21, 2026
Merged

Refactor unit tests#286
vladimir-rangelov merged 2 commits intonext-bidirectionalfrom
ci/refactor-unit-tests

Conversation

@vladimir-rangelov
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 20, 2026 16:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors unit tests by reorganizing test code and OpenRPC specifications into more focused, single-responsibility modules. Methods and properties are renamed with more descriptive "test" prefixes, and tests are separated by functional concern.

Changes:

  • Renamed test methods to use clearer, more descriptive names (e.g., methodtestBasicMethod, methodWithMultipleParamstestMultipleRequiredParams)
  • Split property and event tests from the Advanced module into dedicated PropertyExtension and EventExtension modules
  • Updated copyright notices to 2026 across multiple test files

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test_sdk/suite/simple.test.js Updated method names to match refactored OpenRPC spec (added "test" prefix)
test_sdk/suite/provider.with-multiple-methods.test.js Updated copyright from Sky UK 2025 to Comcast 2026
test_sdk/suite/provider-errors.test.js Updated copyright and renamed requestSimpleMethod to requestBasicMethod
test_sdk/suite/property-with-context.test.js Moved from Advanced to PropertyExtension module; removed event tests (moved to new file)
test_sdk/suite/properties.test.js Migrated from Simple to PropertyExtension module; renamed plainProperty to basicProperty
test_sdk/suite/event-with-context.test.js New test file containing event tests extracted from property-with-context.test.js
test_sdk/openrpc/simple.json Renamed methods with test prefix; moved properties to property-extension.json; added schema tests
test_sdk/openrpc/provider.json Renamed requestSimpleMethod to requestBasicMethod
test_sdk/openrpc/property-extension.json New OpenRPC spec containing all property-related methods from simple.json and event-extension.json
test_sdk/openrpc/event-extension.json Renamed from Advanced to EventExtension; removed property and action methods
test_sdk/sdk/configOverride/languages/markdown/language.config.json New config enabling listen and once declarations
test_sdk/sdk/configOverride/languages/javascript/language.config.json New config enabling listen and once declarations
Comments suppressed due to low confidence (1)

test_sdk/suite/property-with-context.test.js:2

  • The copyright year 2026 is in the future. The current date is January 20, 2026, but code is typically copyrighted for the year it was created. Unless this code is being prepared for a future release, consider using 2025 or the actual year the code was written.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

PropertyExtension.clear();
})
MockTransport.event("Simple","onPlainPropertyChanged", "value 123");
MockTransport.event("PropertyExtension", "onbasicPropertyChanged", "value 123");
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
PropertyExtension.clear();
})
MockTransport.event("Simple","onPlainPropertyChanged", [1,2,3]);
MockTransport.event("PropertyExtension", "onbasicPropertyChanged", [1, 2, 3]);
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
});

//test listen to "onPlainPropertyChanged" event
//test listen to "onbasicPropertyChanged" event
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
let p = Simple.listen("onPlainPropertyChanged", value => {
expect(value).toBe( "value 123")
PropertyExtension.clear("onbasicPropertyChanged");
let p = PropertyExtension.listen("onbasicPropertyChanged", value => {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
expect(value).toBe("value 123")
})
MockTransport.event("Simple","onPlainPropertyChanged", "value 123");
MockTransport.event("PropertyExtension", "onbasicPropertyChanged", "value 123");
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
Simple.clear("onPlainPropertyChanged");
let p = Simple.listen("onPlainPropertyChanged", value => {
expect(value).toBe( "value 123")
PropertyExtension.clear("onbasicPropertyChanged");
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Inconsistent event name casing. The event name is "onbasicPropertyChanged" (lowercase 'b') but should be "onBasicPropertyChanged" (uppercase 'B') to match the naming pattern used elsewhere in the code and to match the expected event name from the basicProperty property.

Copilot uses AI. Check for mistakes.
*/

import { transport } from '../TransportHarness.js'
import MockTransport from '../../build/sdk/javascript/src/Transport/MockTransport.mjs'
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

Unused import MockTransport.

Suggested change
import MockTransport from '../../build/sdk/javascript/src/Transport/MockTransport.mjs'

Copilot uses AI. Check for mistakes.
@vladimir-rangelov vladimir-rangelov merged commit 0d2c19e into next-bidirectional Jan 21, 2026
1 of 2 checks passed
@vladimir-rangelov vladimir-rangelov deleted the ci/refactor-unit-tests branch January 21, 2026 08:58
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants