question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compatibility with eslint-plugin-testing-library

See original GitHub issue

Describe the Feature

It would be lovely to verify that our library is compatible with eslint-plugin-testing-library, determine what’s missing and plan the necessary work to make it usable.

Possible Implementations

I’d like avoid creating another plugin based on the existing one. I’d prefer documenting the shortcomings (e.g. lack of screen if there are rules for that)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
thymikeecommented, Oct 4, 2020
  • prefer-screen-queries. This will require having a screen object.

Only this one is relevant now, since we don’t have screen queries.

1reaction
cross19xxcommented, May 18, 2020

With the exception of the following syntaxes, all other rules are valid and compatible with eslint-plugin-testing-library.

  • no-debug: Using the default debug is seen as a valid syntax, whereas using the debug inside the render method is seen as an invalid syntax, i.e.

    // Valid syntax
    import {debug} from 'react-native-testing-library';
    debug(<Component />);
    
    // Invalid syntax
    import {render} from 'react-native-testing-library';
    const {debug} = render(<Component />);
    

    Luckily, react-native-testing-library@next covers this.

  • prefer-wait-for: This is shown as an invalid syntax the wait method in RNTL is waitForElement. A suggestion will be to have an alias for waitForElement as waitFor. Depending on the state of this (i.e. if on or off), no-wait-for-empty-callback may be triggered

  • prefer-screen-queries. This will require having a screen object.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint Plugin Testing Library Compatibility | React Native ...
Most of the rules of the eslint-plugin-testing-library are compatible with this library except the following: prefer-user-event: userEvent requires a DOM ...
Read more >
eslint-plugin-testing-library - npm
This plugin exports several recommended configurations that enforce good practices for specific Testing Library packages. You can find more info ...
Read more >
eslint-plugin-testing-library/v5.md at main - migration-guides
ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library - eslint-plugin-testing-library/v5.md at main ...
Read more >
eslint-plugin-testing-library
eslint -plugin-testing-library is an ESLint plugin for Testing Library that helps users to follow best practices and anticipate common mistakes ...
Read more >
eslint-plugin-testing-library versions and peer dependencies
Online Peer dependency version tool to search for compatible versions of related NPM packages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found