WordPress/gutenberg

Create Block: Add automated tests to scaffold

Open

#21,360 opened on Apr 2, 2020

View on GitHub
 (3 comments) (4 reactions) (0 assignees)JavaScript (3,893 forks)batch import
Good First IssueNeeds Dev[Status] In Progress[Tool] Create Block[Type] Enhancement

Repository metrics

Stars
 (9,607 stars)
PR merge metrics
 (Avg merge 12d 18h) (509 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe. In order to encourage users to write automated tests, the infrastructure for them should be included in the scaffold from create-block

Describe the solution you'd like Add an option for the esnext template that sets up automated tests that defaults to Y.

Describe alternatives you've considered The main alternative is documentation on how to add automated tests. While I think that's a good first step, scaffolding will ultimetely save time. Create-block is installed 70 times a week right now, if we save 5 minutes for each of those people, almost 6 hours a week will be saved. Across an entire year, that is over 12 days of time.

I also considered making it mandatory, but allowing it to be opted out makes sense to me since there is the possibility that someone may have no interest in automated tests or intends to structure them in a different way.

Contributor guide