Skip to content

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

v3.1.4

29 May 07:28
8065cc3
Compare
Choose a tag to compare

3.1.4 (2020-05-29)

Bug Fixes

  • correct consistent-data-testid docs example (#146) (8065cc3)

v3.1.3

16 May 16:12
55575c9
Compare
Choose a tag to compare

3.1.3 (2020-05-16)

Bug Fixes

v3.1.2

09 May 10:32
28238aa
Compare
Choose a tag to compare

3.1.2 (2020-05-09)

Bug Fixes

  • prefer-screen-queries: false positives when using within method (#119) (28238aa), closes #116

v3.1.1

08 May 07:50
28e23a9
Compare
Choose a tag to compare

3.1.1 (2020-05-08)

Bug Fixes

  • no-manual-cleanup: check require imports properly (#128) (28e23a9), closes #125

v3.1.0

04 May 14:55
Compare
Choose a tag to compare

3.1.0 (2020-05-04)

Features

  • migrate plugin to typescript-eslint (#121) (3439a29). This is not actually adding any new feature to the plugin but we wanted to bump a minor version here so the migration can be noticed properly.

v3.0.4

19 Apr 10:16
cedb56b
Compare
Choose a tag to compare

3.0.4 (2020-04-19)

Bug Fixes

  • async checks when calling queries member expressions (#114) (cedb56b), closes #113

This bug fix makes sure await-async-query and no-await-sync-query rules work fine when checking queries used from screen util.

v3.0.3

07 Apr 08:00
Compare
Choose a tag to compare

3.0.3 (2020-04-07)

Bug Fixes

v3.0.2

01 Apr 07:30
321e2a5
Compare
Choose a tag to compare

3.0.2 (2020-04-01)

Bug Fixes

v3.0.1

31 Mar 07:11
6c8f14a
Compare
Choose a tag to compare

3.0.1 (2020-03-31)

Bug Fixes

  • check namespaced imports for no-debug and prefer-wait-for (#102) (6c8f14a), closes #101

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)