Skip to content

Use consistent test style across codebase #560

Open
@LauraBeatris

Description

@LauraBeatris

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:

  1. What would be the best test style for this codebase: Declarative or Imperative?
  2. How to enforce a test style?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs specificationThe desired behavior is not defined yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions