Skip to content

Issue: custom queries option is disregarded when passed to render function #52

Closed
@Odedgefen

Description

@Odedgefen

Hey,
Trying to enrich the global queries as based on code snippet in official docs doesn't work

import { render, queries } from '@testing-library/svelte' 
import * as customQueries from './custom-queries'`

const customRender = (ui, options) =>
  render(ui, { ...options, queries: { ...queries, ...customQueries }})

// re-export everything
export * from '@testing-library/react'

// override render method
export { customRender as render }

It looks like queries in options are not passed to the getQueriesForElement as second parameter:
https://github.com/testing-library/svelte-testing-library/blob/master/src/index.js#L23

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