0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

recompose(HOC)を使用したReactコンポーネントのテストでどハマりした件

Posted at

テストで何も返ってこなくて大変どハマりしたので備忘録。

解決策を見つけたのは私ではないけれどドヤ顔で書いてる(嘘)

私自身、初めてテスト書いていきなりハマったので、常識とかよくわかってないけど書いています。まさかり歓迎。

環境

  • enzyme
  • recompose

ハマったこと

recomposeのwithHandlersとwithStateを使用したコンポーネントで返ってくるはずのコンポーネントが返ってきてないのでテストに落ちる

解決策

enzymeのissueにあるらしい。(見つけたのは僕ではない)

要は、composeの引数の数だけdive()するしかないらしい。

なんてことだ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?