Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Odedgefen opened this issue Sep 12, 2019 · 1 comment

Comments

@Odedgefen
Copy link

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

@mihar-22
Copy link
Collaborator

mihar-22 commented Oct 8, 2019

Hey @Odedgefen just letting you know this has been resolved in the recent update. You can pass it into the render function as the third parameter render(Component, ComponentOptions, RenderOptions). Enjoy!

@mihar-22 mihar-22 closed this as completed Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants