Skip to content

Add bindQueriesToElement to remove need for duplicated code in libraries built on dom-testing-library #17

Closed
@dfcook

Description

@dfcook

There's a block of code used by vue-testing-library, react-testing-library and in the tests here:

   const containerHelpers = Object.entries(queries).reduce(
    (helpers, [key, fn]) => {
      helpers[key] = fn.bind(null, element)      
      return helpers
    },
    {},
  )

I propose adding a bindQueriesToElement utility function to encapsulate this code.

Metadata

Metadata

Assignees

No one assigned

    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