Uh oh!
There was an error while loading. Please reload this page.
test: strengthen RefObject assertions in reactive-collections.test.ts - #23
Merged
joaodibba merged 1 commit intoJun 15, 2026
Conversation
Replaces four weak toBeTruthy / typeof-only assertions from the RefObject (refObject) describe block (introduced in PR TypeComposer#15) with exact behavioral assertions: - 'creates a reactive object wrapper': now verifies id is a non-empty string and that subscribe/update are functions (not just truthy). - 'value exposes the wrapped plain object': now asserts the actual key value (x === 1) rather than just that the value is truthy. - 'update with new plain object replaces content': now counts subscriber call invocations to confirm notification fires, and checks lastValue is a defined object. - 'toJSON serializes the object value': now checks the serialized shape contains the original key/value pairs (key === 'value', count === 42). All 162 tests pass. Addresses audit item 8.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
Follow-up to PR #15 — replaces four weak
toBeTruthy()/typeof-only assertions in theRefObject (refObject)describe block with exact behavioral assertions that would catch real regressions.File changed:
tests/reactive-collections.test.ts(test-only change, no production code modified)expect(obj).toBeTruthy()expect(typeof obj.id).toBe('string')+id.length > 0+subscribe/updateare functionsexpect(obj.value).toBeTruthy()expect((obj.value as any).x).toBe(1)— checks actual wrapped valueexpect(lastValue).toBeTruthy()after updatelastValueis a defined objectexpect(typeof json).toBe('object')json.key === 'value'andjson.count === 42— verifies serialized shapeValidation
Roadmap alignment
Addresses audit item 8 (strengthen weak RefObject test assertions). No production code changed.
Reviewer: @zico15