The extensible BDD assertion toolkit

Copenhagen, Denmark
ICYMI: If you're still using enzyme, you should read this medium.com/@bruderstein/enzy…
3
3
unexpected-react works just fine with React 15.5. We rely on very few react internals, so things are generally 👌
2
4
Replying to @bruderstein
Finally something I can refer people to, to convince them of @unexpectedjs. This would also make a 🔝💯 blog post.
2
3
I'll storify these because I can't twitter and I messed the thread up yesterday 🙃 Hope you've seen enough to at least try it! #unexpected 🎉
1
1
3
`queried for` searches the tree, then you can assert on the subtree, or take a snapshot of just that part of the tree #unexpected
1
1
1
Snapshots on the full DOM just work too, no extras needed. And you get the same great diffs that are based on real objects, not strings
1
1
1
Now a `to contain` in the full DOM renderer - another case where you only see the actual problem in the #unexpected output
1
1
1
Continuing the series on unexpected-react, now for full DOM rendering. You get the same tree as the react devtools... #unexpected
1
3
2
...so let's use indexes instead to identify the second button. Which test helps you understand the component better?
1
1
2
Now we'll render 2 buttons, and try and trigger the event on the one with `second` className. But it isn't set, so it can't find the target
1
1
1
Same test, different problem (note you can't actually tell what the problem is from the enzyme output) #unexpected
3
4
6
...and now an event, when the rendered output is wrong (we'll see this test again 😀) #unexpected
3
5
13
Gonna do a series of tweets comparing unexpected-react tests with enzyme and their outputs - hope you enjoy it :) #unexpected
1
7
20
Let's start with a really simple test... (these tests are 100% equivalent) #unexpected
1
10
21
Seriously though, you should read this, see how nice it would be, then look at @unexpectedjs
A shared matcher library could give the sort of lift to the JS testing ecosystem that Promises did for async coding. blog.thepete.net/blog/2017/0…
2
1
Unexpected retweeted
Last talk for today at 2:30 in #console: Testing Discussion. Demo of unexpected react - Dave Brotherstone @bruderstein #jsunconf
1
2
Unexpected retweeted
That moment when you see something 'unexpected'
3
178
297
Unexpected retweeted
Completely unexpectedly @bruderstein hops on the #jsunconf stage to propose a talk… on @unexpectedjs 😅
2
5