Unit tests for src/lib/github-following.ts

オープン 初心者向け
#3,709 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@KartikeyG-world がすでに取り組んでいます。

2026年12月1日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github, redis, typescript
領域
api, testing

調査の方向性

src/lib/github-following.ts から始めて、getFollowing() が /users/{login}/following をどのようにページ送りし、10ページの上限を適用し、Redis キーを読み書きしているかを確認してください。test/leaderboard-cold-load.test.ts の Redis モックの方法を流用し、ネットワークを使わないように fetch/githubRequest をモックしてください。新しいユニットテストがページ送り、ページ上限、6時間TTLのキャッシュヒット、エラー時にキャッシュしないこと、小文字化をカバーし、オフラインで合格すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue level 1 level:beginner status:assigned type:testing
Summary

getFollowing() powers the leaderboard's Following view. It's only covered by an e2e test.

Where

src/lib/github-following.ts. See test/leaderboard-cold-load.test.ts for how Redis is mocked.

What to test
  • Pages through /users/{login}/following (100 per page) and stops on a short page
  • Stops at the 10-page cap
  • Stores the result in Redis under github:following:v1:<login> with a 6h TTL, and returns the cached set on the next call
  • Doesn't cache when GitHub returns an error
  • Lower-cases logins
Acceptance criteria
  • Tests pass with no network access (mock fetch/githubRequest and Redis)
主要言語
TypeScript
スター
246
フォーク
436
平均マージ
9時間 33分
マージ済み PR(30日)
213

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Priyanshu-byte-coder/devtrack のほかの issue

Priyanshu-byte-coder/devtrack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。