Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Application works as expected, but unit tests fail in with 404 NotFoundError

オープン
#9,819 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
nodejs, typescript
領域
api, backend, testing

調査の方向性

まず、LoopBack CLIで生成されたアプリケーションとそのユニットテストで障害を再現し、createRestAppClient、/pingルート、app.getRepository(MyRepository)に焦点を当てます。初期化ログと報告されたrepositories.MyRepositoryのバインディングエラーを確認します。コントローラーとリポジトリのテストが404や解決不能なリポジトリエラーなしで実行されれば完了です。

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

説明

bug
Describe the bug

I created a simple application with lb4 cli, and it works fine when I run it. However, when I run a unit test, all controller, and repository tests fail. During the test, my application starts and the application init and start events both fire, and I successfully create a client using createRestAppClient. The home page works and so does the explorer page. However, the /ping route generates a 404 NotFoundError and the app.getRepository(MyRepository fails with MyRepositiry "is not bound to any value in context". What am I missing?

Logs
ResolutionError: The key 'repositories.MyRepository' is not bound to any value in context MyApplication-roGIIRWyRTi6GQlKUsHn_Q-0 (context: MyApplication-roGIIRWyRTi6GQlKUsHn_Q-0, binding: repositories.MyRepository)
Additional information

No response

Reproduction

Upcoming

主要言語
TypeScript
スター
5.1k
フォーク
1.1k
平均マージ
4日 22時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

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

loopbackio/loopback-next のほかの issue

loopbackio/loopback-next の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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