Skip to content

Releases: testing-library/eslint-plugin-testing-library

v3.0.0

29 Mar 17:28
8c2dc0c
Compare
Choose a tag to compare

3.0.0 (2020-03-29)

Features

  • await-async-utils: reflect waitFor changes (#89)
  • new rule no-wait-for-empty-callback (#94)
  • new rule prefer-wait-for (#88)
  • new rule prefer-screen-queries (#99)
  • new rule prefer-presence-queries (#98)

prefer-wait-for

This new rule is fixable so it can help you migrating deprecated wait, waitForElement and waitForDomChange to new waitFor method.

From this:

import { render, wait, waitForElement, waitForDomChange } from '@testing-library/dom';

async () => {
  render(<SomeComponent />);

  await wait();
  await wait(() => expect(screen.getByText('submit')).not.toBeInTheDocument());
  await waitForElement(() => {});
  await waitForDomChange();
  await waitForDomChange({ timeout: 100 });
};

to this:

import { render, waitFor } from '@testing-library/dom';

async () => {
  render(<SomeComponent />);

  // `wait` without callback is replaced with `waitFor` with empty callback
  await waitFor(() => {});

  // `wait` with some callback is replaced with `waitFor` keeping same callback
  await waitFor(() => expect(screen.getByText('submit')).not.toBeInTheDocument());
  
  // same for `waitForElement`
  await waitFor(() => {});

  // same for `waitForDomChange`
  await waitFor(() => {});

  // `waitForDomChange` options are passed as 2nd arg to `waitFor`
  await waitFor(() => {}, { timeout: 100 });
};

BREAKING CHANGES

  • drop support for node v8. Min version allowed is node v10.12 (#96)
  • rule no-get-by-for-checking-element-not-present removed in favor of new rule prefer-presence-queries (#98)

v2.2.3

11 Feb 10:21
34da6c1
Compare
Choose a tag to compare

2.2.3 (2020-02-11)

Bug Fixes

  • no-get-by-for-checking-element-not-present: false positives for negated matchers (#84) (34da6c1)

v2.2.2

10 Feb 21:34
ba34a62
Compare
Choose a tag to compare

2.2.2 (2020-02-10)

Bug Fixes

v2.2.1

04 Feb 16:01
caeebb4
Compare
Choose a tag to compare

2.2.1 (2020-02-04)

Bug Fixes

v2.2.0

01 Feb 20:49
153bb3a
Compare
Choose a tag to compare

2.2.0 (2020-02-01)

Features

  • no-debug: scan for screen.debug() (#73) (153bb3a)

v2.1.0

30 Jan 18:11
050cd4f
Compare
Choose a tag to compare

2.1.0 (2020-01-30)

Features

v2.0.0

28 Jan 15:06
1aa9238
Compare
Choose a tag to compare

2.0.0 (2020-01-28)

Features

  • new rule await-async-utils (#69) (6420867)
  • new rule no-get-by-for-checking-element-not-present (#65) (1aa9238)

BREAKING CHANGES

  • rule prefer-expect-query-by has disappeared in favor of new rule no-get-by-for-checking-element-not-present

v1.5.0

22 Jan 14:55
Compare
Choose a tag to compare

1.5.0 (2020-01-22)

Features

  • add support for resolves/rejects matchers in async queries (#64) (d0a1585)

v1.4.1

15 Jan 16:48
Compare
Choose a tag to compare

1.4.1 (2020-01-15)

Bug Fixes

  • prefer-expect-query-by: remove rule from shareable configs (#60) (93e2a8b)

Note that prefer-expect-query-by has to be manually enabled from now on.

v1.4.0

13 Jan 16:29
Compare
Choose a tag to compare

1.4.0 (2020-01-13)

Features