Skip to content

Add node:test suite to reactnative-for-template - #57

Merged
wf9a5m75 merged 1 commit into
developfrom
test/rn-template-tests
Nov 11, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
test/rn-template-tests

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

このパッケージにはテストがなかったので、node:test のスイートを追加します。

  • react-native は test/helpers/react-native-stub.mjs に差し替えます。このスタブは、UIManager.dispatchViewManagerCommand で送られたコマンドを記録します。
  • test/helpers/buildPackage.mjs は、tsup で src/index.ts を build/ 下の一時ディレクトリへビルドします。
  • 確かめていること:
    • ビューがネイティブへ渡す props(ビュー名、デザイン値、API キー)
    • コントローラのコマンド(ロード前の保留、マーカーのバッチ送信)
    • ネイティブからのイベントの戻り
    • 公開している export と、ビルド結果が import するパッケージの範囲(Metro/Hermes で web 専用のコードを読み込まない)
  • package.json の test を node --test "test/**/*.test.mjs" に変えます。
  • .gitignore が *.mjs を丸ごと除外しているパッケージでは、!test/**/*.mjs を足しています。
  • src/ は変更していません。

npm test がすべて通ることを確認しました。

@wf9a5m75
wf9a5m75 merged commit 89fccba into develop Nov 11, 2026
3 checks passed
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.

1 participant