Open
Description
In #558 discussions, we've noticed that the test files across the codebase have a mix of declarative and imperative style.
What happened: When contributing for the first time, I didn't know what style to follow while coding the tests since it's mixed across the codebase and there's tool/docs mention to enforce it
The following code is from __tests__/paste.js
// declarative
test('should paste text in textarea', () => { ... }
// imperative
test('does not paste when readOnly', () => { ... }
Reproduction repository: Go through the tests file of the codebase and see a mixture of declarative and imperative styles.
Problem description: Contributors should know whether style to choose, the current situations may cause a lot of confusion and PR discussions
Suggested solution: Discuss in this issue the following topics:
- What would be the best test style for this codebase: Declarative or Imperative?
- How to enforce a test style?