test(units): improve test structure and expand coverage across all unit modules#242
Merged
michaeljymsgutierrez merged 10 commits intoJun 30, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
michaeljymsgutierrez
added a commit
that referenced
this pull request
Jun 30, 2026
- [c099dd9][michaeljymsgutierrez]: Updated release version from v2.9.0 to v2.9.1 - 2026-07-01 02:27:36 - [9ca0c99][Chael Gutierrez]: fix(deploy): rename release branch prefix to releases to avoid ref collision (#245) - 2026-07-01 02:26:00 - [f823754][Chael Gutierrez]: chore(deps): fix dependabot security alerts - upgrade vite, vitest, form-data and markdown-it (#244) - 2026-07-01 01:55:56 - [2fcec47][Chael Gutierrez]: chore(deploy): add pre-flight checks, dry-run mode, canary sync, path safety and fail-fast (#243) - 2026-07-01 01:36:47 - [8cf2be1][Chael Gutierrez]: test(units): improve test structure and expand coverage across all unit modules (#242) - 2026-07-01 00:38:33 - [81e929f][Chael Gutierrez]: docs(contributing): add branch purposes, flow diagram, and toc updates (#241) - 2026-06-29 02:27:20 - [9e02459][Chael Gutierrez]: docs(contributing): add CONTRIBUTING.md and link from README (#240) - 2026-06-29 02:07:47 - [b8e9297][Chael Gutierrez]: chore(deps): upgrade production dependencies (#239) - 2026-06-24 02:57:14
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.
Description
Improves the test suite structure and expands coverage across all unit test modules. Adds
beforeEachcollection resets to eliminate cross-test state leakage, removes redundant boilerplate inside individual tests, fixes a silent no-op (setNamespaceon a frozen instance), and adds 18 new test cases covering previously untested behaviors introduced across recent releases.Github Issue: N/A
Changes
packages/tests/mirage/index.js- addedPOST /addressesroute to supportsave()on new recordspackages/tests/units/init.js- addedsetPayloadIncludeReferencetest using a fresh ARM instance (shared instance is frozen viasetGlobal())packages/tests/units/request.js- addedbeforeEachcollection reset, removed no-opsetNamespace, addedautoResolvedefault behavior testpackages/tests/units/retrieve.js- addedbeforeEachcollection reset, removed no-opsetNamespace, addedpeekRecordundefined andgetAliasfallback testspackages/tests/units/remove.js- addedbeforeEachcollection reset, removed no-opsetNamespace, added alias cleanup test forunloadRecordpackages/tests/units/push.js- addedbeforeEachcollection reset, removed no-opsetNamespace, addedpushPayloadwith included data testpackages/tests/units/create.js- addedbeforeEachcollection reset, removed no-opsetNamespace, addedcreateRecordwith custom attributes testpackages/tests/units/record.js- addedbeforeEachcollection reset, removed no-opsetNamespaceand redundant boilerplate from all existing tests, addedsavePOST for new record,savewith string record ID (v2.9.0), androllbackAttributesaftersetPropertiestestspackages/tests/units/utils.js- addedsortByascending direction,findByno-match,filterByno-match, andmergeObjectsdeduplication testspackages/tests/units/internals.js- removed no-opsetNamespace, fixed_getBaseURLassertion to reflect frozen namespace (api/v2), added_injectCollectionReferenceKeysdefault values testScreenshots/Images
N/A
How Has This Been Tested?
yarn test- all 81 tests pass with no regressionsChecklist
Reviewer Guidance
yarn testinsidepackages/and verify all 81 tests passsetNamespacecalls outsidedescribe/testblocks were no-ops because the shared ARM instance is frozen viasetGlobal()- removing them makes the code honest_getBaseURLassertion now correctly reflectsapi/v2(the namespace frozen at init time), notapi/v1setPayloadIncludeReferencetest uses a freshApiResourceManagerinstance because plain (non-observable) properties cannot be mutated on the frozen shared instanceautoResolvetest only asserts the initial hash shape - when XHR completes,_pushRequestHashreplaces (not mutates) the entry, making the captured reference stale