-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I was learning about writing tests for react components, mainly what it looks like to TDD(Test Driven Development) react components and I came across AAA.
It's another structure for writing good tests:
Arrange - set up everything the test needs; initialise functions, render components, pass in props, test data, contexts, mock ext. dependencies etc.
Act - perform the behaviour we want to test, like firing a user effect, calling a function, awaiting async effects and so on
Assert - check that the observed outcome matches the expectations
In the Rails world where we use Rspec, AAA draws parallel with describe -> context -> it
Reactions are currently unavailable