pass parameter to throw
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- testing
調査の方向性
まず、issue の JavaScript の例と、throw されたエラーに対する assertion API を確認します。ラッパーなしでパラメーター化された throw assertion を実現する方法を検討し、要求された使い方を示して期待されるエラーメッセージを確認するテストカバレッジを追加します。
索引モデルが issue の本文から書いたものです。
説明
Support plan
- is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): no
Context
- node version: > 18.13.0
- module version: ^9.02
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): hapi
- any other relevant information:
What problem are you trying to solve?
I am testing a function that requires me to pass a parameter to it. In certain cases it will throw an Error. I am unable to test this function without making a wrapper for it.
const foo = (message) => {
throw Error(message)
}
let msg = "sup hapi devs"
expect(foo(msg)).to.throw(msg) // Epic fail
const wrapper = () => foo(msg)
expect(wrapper).to.throw(msg) // Success!
Do you have a new or modified API suggestion to solve the problem?
I'll look into it, just wanted to see if this concern is legitimate.
- 主要言語
- JavaScript
- スター
- 231
- フォーク
- 75
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hapijs/code のほかの issue
-
support
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
feature
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
似ている issue
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
githubnext/gh-aw-workshop#4458 ·
メンテナーはふだん 1 日以内に返信
-
Add: Cartoonitoオープンcheck:failed feeds:add
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
iptv-org/database#37390 · コメント 1 件 ·
メンテナーはふだん 9 日以内に返信
-
bug: directory index route root priority is overwritten when wildcard is false対応中かも @TalhaHunter101 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
fastify/fastify-static#617 ·
-
agent/sec-check hive/hosted-available-lke648397-260827-5n31 security
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信