Skip to content

feat: comprehensive tests and react 19 support#1023

Open
losboss wants to merge 19 commits into
missive:mainfrom
eolhq:feat/react-19-support
Open

feat: comprehensive tests and react 19 support#1023
losboss wants to merge 19 commits into
missive:mainfrom
eolhq:feat/react-19-support

Conversation

@losboss

@losboss losboss commented Mar 29, 2026

Copy link
Copy Markdown

losboss added 15 commits March 29, 2026 06:37
Add comprehensive tests for SearchIndex covering SHORTCODES_REGEX, get(), search(), and reset() with mocked config/Data. Also expand config.test.js with full coverage of init(), getProps(), and getProp().
Adds 35 tests covering init(), getProps(), and getProp() behaviors including data loading, emoticon/native maps, alias processing, search string building, custom categories, filtering, and type coercion edge cases.
Add 13 new test cases covering fetchJSON CDN fetch and caching,
caller warning, re-init custom category filtering, non-English i18n
fetch, custom category target assignment, categoryIcons, noCountryFlags
SafeFlags filtering, and latestVersionSupport version filtering.
Coverage: 86% → 100% statements/lines, 93.45% branches, 100% functions.
Mock the canvas context and navigator.userAgent to test the IIFE
detection path that normally only runs in real browsers. Covers
pixel comparison, measureText width check, color matching, and
caching behavior.
Node 16 is EOL since September 2023. Update to Node 20 LTS
(20.18.3) which is required by @testing-library/react@16.
Replace React.createElement with JSX syntax, remove default React import,
and add package-level tsconfig to scope React's JSX runtime. Remove
jsxImportSource from root tsconfig since Parcel auto-detects it from
package.json dependencies.
The root tsconfig had jsxImportSource set to preact, but the React
wrapper package needs React's JSX runtime. Parcel 2.6.2 doesn't
respect package-level tsconfigs, so we remove jsxImportSource from
root and set it explicitly in each package.
Adds a jsdom-based test suite for the React wrapper using @testing-library/react
and a mocked Picker class to validate renders, prop passing, re-renders, and unmount.
Configures ts-jest in jest.config.js to include @types/jest and jsxImportSource=react.
@losboss losboss force-pushed the feat/react-19-support branch 2 times, most recently from 8c162e6 to 8cc2bc8 Compare March 29, 2026 11:05
losboss added 4 commits March 29, 2026 07:09
- TypeScript 4.6.4 → 5.8.3 (required for modern @types/node)
- Jest 28 → 29, ts-jest 28 → 29 (required for TS 5)
- Parcel 2.6.2 → 2.16.4 (required for TS 5 type generation)
- Add per-package tsconfigs with include scoping
- Update check:types to run per-package type checking
- Add coverage/ to .prettierignore
@ragnarok22

Copy link
Copy Markdown

@EtienneLem any change to have some updates on this package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants