Skip to content

API proposal: Jest Native matchers migration #1468

Closed
@mdjastrzebski

Description

@mdjastrzebski

API proposal for Jest matchers migration

This issue describes the desired API regarding Jest matchers to be included in RNTL package, and that should replace the Jest Native package matchers.

Problems with the current Jest Native matchers:

  • lack of maintainers
  • inconsistent RN env simulation vs RNTL
  • potential version mismatch between JN and RNTL packages
  • matchers frequently relying on RN implementation details prone to break in case of RN change

The goals of this initiative are as follows:

  • Bring non-maintained Jest Native matchers into well-maintained RNTL project
  • Tie matchers to RNTL release hence preventing matcher incompatibility, full test coverage
  • Review and improve internal matcher implementation, align behaviour with RNTL
  • Add missing matchers, based primarily on Jest DOM matchers
  • Provide gradual migration path for existing users of @testing-library/jest-native

Matchers to keep

Matchers to change signature

Matchers to add

Matchers to remove

  • toHaveAccessibilityState - to be replaced by toBeDisabled, toBe(Partially)Checked, etc

Migration path

  • Create RNTL documentation for matchers
  • Create migration guide
  • Expose legacy export in Jest Native package
  • Update Jest Native docs that it is deprecated
  1. Jest Native package will allow for importing existing matchers with legacy prefix, so that users will avoid name clashes on expect function. This will be provided by Jest Native and not the RNTL in order to avoid having to managed that code inside RNTL and to keep it in the final state for potentially long time.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions