Testing · mastra-ai/mastra
Extend unit tests for Mastra storage utilities
Adds unit test coverage for duration parsing, date handling, date-range filtering, and JSON value equality in Mastra core. The change also simplifies portions of the existing storage utility tests.
The problem
The PR targets additional coverage for parseDuration, ensureDate, serializeDate, filterByDateRange, and jsonValueEquals in the storage utilities module. The supplied description does not identify a specific runtime defect or describe the individual new test cases.
The approach
Extends the existing Vitest test file to import the five targeted utilities and adds coverage described in the PR. The visible diff also removes explanatory comments and redundant empty-object length assertions from existing safelyParseJSON tests while retaining equality and reference checks. A patch changeset records the test coverage addition for @mastra/core.
What changed
Adds storage utility unit tests and a patch changeset without modifying the utility implementation. The truncated diff does not show the new test assertions or test execution results.
- vitest
- typescript
- unit-tests
- storage
- date-handling
- json