Testing Blocks
The create-testers
package will include testing utilities that provide mock data to a block under test.
For example, this test asserts that an nvmrc block creates an ".nvmrc"
file with content "20.12.2"
:
Options
Block options may also be provided through createMockBlockContext()
.
This test asserts that a Prettier block adds config options to its output ".prettierrc.json"
: