Commit Graph

248 Commits

Author SHA1 Message Date
Michał Pierzchała c2c39c4643 v2.0.0-rc.1 v2.0.0-rc.1 2020-05-21 16:18:17 +02:00
Maciej Jastrzebski 4adb92b608 feat: wrap waitFor in (async) act to support async queries without explicit act call (#344)
* Wrapped waitFor call in act to support async waitFor/findBy

* Updated docs

* Spelling mistake

* Added short info in migration guide

* Corrected spelling

* Clarified comments

* Added async act implementation conditional on React version

* Code review changes

* Update src/waitFor.js

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Update src/waitFor.js

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Fixed prettier

* Update src/waitFor.js

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-21 16:07:57 +02:00
Michał Pierzchała 10bae7d891 v2.0.0-rc.0 v2.0.0-rc.0 2020-05-21 09:49:53 +02:00
Michał Pierzchała 0253d4a864 docs: cleanup migration doc (#342) 2020-05-20 22:23:43 +02:00
Maciej Jastrzebski c3074b67af chore: rename Migration20.md to MigrationV2.md (#341) 2020-05-20 16:39:50 +02:00
Maciej Jastrzebski b595c741d8 chore(breaking): deprecate flushMicrotasksQueue (#340)
* Deprecated flushMicrotasksQueue

* Update website/docs/Migration20.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Renamed flushMicrotasksQueueInternal to flushMicroTasks

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-20 16:33:19 +02:00
Maciej Jastrzebski 4d0e44895a Spelling mistake 2020-05-20 13:43:33 +02:00
Alec Larson 175b9b9fa2 feat: call "cleanup" automatically (#238)
* feat: add "cleanup" function

* docs: add "cleanup" section

* feat: automatically call "cleanup" after each test

...if an "afterEach" global function is defined, and process.env.RTL_SKIP_AUTO_CLEANUP is falsy.

Taken from: https://github.com/testing-library/react-testing-library/blob/14670debd45236d2c5d0a61a83dadc72af1bef7c/src/index.js

* docs: mention automatic cleanup

* add within

* fix lint

* Updated tests, added auto-cleanup test

* Added ways to prevent auto cleanup

* Small fix

* Code review changes

* Update website/docs/API.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* More changes

* Removed  afterEach(cleanup) calls in examples

* Code cleanup

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2020-05-20 13:33:28 +02:00
Maciej Jastrzebski 3ef00642d2 chore: reorganize TS test file (#337) 2020-05-20 10:37:18 +02:00
Maciej Jastrzebski 25f2701fdf feat: update docs bases on cancelled prepare-2 PR (#335)
* Adapt docs changes from `prepare-2` branch

* WIP

* Removed unused `printUnsafeWarning` function

# Conflicts:
#	src/helpers/errors.js

* Code review changes
2020-05-19 16:58:27 +02:00
Maciej Jastrzebski 535e0bc6bd Feat(breaking): remove deprecated functions (#334)
* WIP

* More changes

* WIP

* Added throwRemovedFunctionError docsRef

* Fixed tests

* Typescript types cleanup

* Cleanup

* Moving some changes from `prepare-2` branch

* Moving some changes from `prepare-2` branch

* Update src/waitFor.js

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Update website/docs/Migration20.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Code review changes

* More code review changes

* Code review changes

* More code review changes

* Added @deprecated messages for TS type defs

* Spelling mistake

* Reformatted index.d.ts

* Removed remaining refs to warnFn

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-19 16:18:05 +02:00
Michał Pierzchała 0fc50d4e52 chore(breaking): compile project to Node 10 using @babel/preset-env (#309)
* chore: compile project to Node 8.3 using @babel/preset-env

* update snapshots

* compile to Node 10

* adjust snapshots back

* add migration docs
2020-05-19 08:29:14 +02:00
Maciej Jastrzebski 38792e943b Feat(breaking): unify wait for element signature with testing library (#327)
* Change argument to options object

* Renamed `waitForElement` to `waitFor`

* Migration guide entry

* Fixed typescript check

* Update src/helpers/a11yAPI.js

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* (Nearly) Empty migration doc for ver. 2.0 (#326)

* Added migration docs section

* Added to docosaurus side bar

* Updated README

* Increased async test timeout

* Update website/docs/Migration20.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* feat(breaking): remove legacy `debug` export (#328)

* Removed global `debug` functions

* Removed global `debug` from docs

* Cleanup

* Added migration section

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-18 17:49:54 +02:00
Maciej Jastrzebski 6a6e614025 feat(breaking): remove legacy debug export (#328)
* Removed global `debug` functions

* Removed global `debug` from docs

* Cleanup

* Added migration section

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-18 16:19:08 +02:00
Maciej Jastrzebski ad9e5a3352 (Nearly) Empty migration doc for ver. 2.0 (#326)
* Added migration docs section

* Added to docosaurus side bar

* Updated README

* Increased async test timeout

* Update website/docs/Migration20.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-18 16:10:01 +02:00
Maciej Jastrzebski c9c131e5e7 fix(breaking): getByTestId should work only for native elements (#324)
* Replaced getByTestId with fixed version

* Added tests

* Fixed flow-check

* Updated docs

* Fixed lint error

* Used getByTestId in unit tests instead of queryByTestId

* Updated negative checks in tests
2020-05-18 13:00:48 +02:00
dependabot-preview[bot] 43b12911a5 chore(deps-dev): bump release-it from 13.6.0 to 13.6.1 (#322)
Bumps [release-it](https://github.com/release-it/release-it) from 13.6.0 to 13.6.1.
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/13.6.0...13.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-18 11:12:01 +02:00
dependabot-preview[bot] e7e7f1bd7b chore(deps-dev): bump @babel/core from 7.9.0 to 7.9.6 (#323)
Bumps [@babel/core](https://github.com/babel/babel) from 7.9.0 to 7.9.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.9.0...v7.9.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-18 11:11:42 +02:00
dependabot-preview[bot] 18538bf1f6 chore(deps-dev): bump @types/react-native from 0.62.3 to 0.62.10 (#321)
Bumps [@types/react-native](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-native) from 0.62.3 to 0.62.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-native)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-18 11:11:12 +02:00
Michał Pierzchała 6288299587 Release 1.14.0 v1.14.0 2020-05-18 09:43:34 +02:00
Maciej Jastrzebski 414f8701a5 feat: Support for @testing-library/jest-native (#310)
* Added @testing-library/jest-native to devDependencies

* Tests for jest-native matchers

* Added @testing-library/jest-native install info

* Update README.md

* Update GettingStarted.md

* feat: add `findBy*` queries (#304)

* Basic async findBy queries

* Refactored findBy queries to be built with makeFindQuery

* findBy queries for A11y selectors

* Custom findByTestId implementation that avoids current getByTestId issues

* Fixed prettier issue

* Updates Queries.md with findBy queries

* Trying to fix test timeout error appearing only on CI

* Code review changes

* Added typescript types & tests

* prettier did reformat some code arround

* Removed export of GetByAPI, QueryByAPI and FindByAPI interfaces in TS

* Reversed prettier run on typings

* Added overlapping pieces with `within` operator

* Small cleanup

* Update website/docs/Queries.md

* Moved async/await tests to the end of test methods

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* chore: bump eslint config to latest (#308)

* chore: bump eslint config to latest

* lint fix

* lint pass

* use roles directly

* Trying to fix CI build

* Added $FlowFixMe for missing flow expect extensions

* Small doc fixes

* Clarified failing toHaveProps matcher tests

* Moved lint ignore for color literals to .eslintrc

* Updated toHaveProp tests to avoid strange `Button` behavior

* Updated yarn.lock

* Update README.md

* Update website/docs/GettingStarted.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-18 09:37:59 +02:00
dependabot-preview[bot] c482f6ad07 chore(deps-dev): bump release-it from 12.6.3 to 13.6.0 (#312)
Bumps [release-it](https://github.com/release-it/release-it) from 12.6.3 to 13.6.0.
- [Release notes](https://github.com/release-it/release-it/releases)
- [Changelog](https://github.com/release-it/release-it/blob/master/CHANGELOG.md)
- [Commits](https://github.com/release-it/release-it/compare/12.6.3...13.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 20:05:47 +02:00
dependabot-preview[bot] 966f7957c1 chore(deps-dev): bump eslint from 6.8.0 to 7.0.0 (#315)
Bumps [eslint](https://github.com/eslint/eslint) from 6.8.0 to 7.0.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v6.8.0...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 19:52:51 +02:00
dependabot-preview[bot] 5297a0468a chore(deps-dev): bump @release-it/conventional-changelog (#314)
Bumps [@release-it/conventional-changelog](https://github.com/release-it/conventional-changelog) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/release-it/conventional-changelog/releases)
- [Commits](https://github.com/release-it/conventional-changelog/compare/1.1.3...1.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 19:52:35 +02:00
dependabot-preview[bot] 4269564112 chore(deps-dev): bump typescript from 3.8.3 to 3.9.2 (#313)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.8.3 to 3.9.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.8.3...v3.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 19:47:20 +02:00
dependabot-preview[bot] 078499ec5b chore(deps-dev): bump conventional-changelog-cli from 2.0.31 to 2.0.34 (#316)
Bumps [conventional-changelog-cli](https://github.com/conventional-changelog/conventional-changelog) from 2.0.31 to 2.0.34.
- [Release notes](https://github.com/conventional-changelog/conventional-changelog/releases)
- [Commits](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-cli@2.0.31...conventional-changelog-cli@2.0.34)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 19:46:39 +02:00
Michał Pierzchała 29ce4f2b48 chore: bump eslint config to latest (#308)
* chore: bump eslint config to latest

* lint fix

* lint pass

* use roles directly
2020-05-15 10:10:49 +02:00
Maciej Jastrzebski ab34712133 feat: add findBy* queries (#304)
* Basic async findBy queries

* Refactored findBy queries to be built with makeFindQuery

* findBy queries for A11y selectors

* Custom findByTestId implementation that avoids current getByTestId issues

* Fixed prettier issue

* Updates Queries.md with findBy queries

* Trying to fix test timeout error appearing only on CI

* Code review changes

* Added typescript types & tests

* prettier did reformat some code arround

* Removed export of GetByAPI, QueryByAPI and FindByAPI interfaces in TS

* Reversed prettier run on typings

* Added overlapping pieces with `within` operator

* Small cleanup

* Update website/docs/Queries.md

* Moved async/await tests to the end of test methods

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-15 09:52:33 +02:00
Maciej Jastrzebski 1809825313 feat: add within operator for returned instance-bound queries (#306)
* Basic within implementation and tests

* Added typescript types & tests

* Removed duplicated import in index.d.ts

* Reversed prettier run on typings

* Fixed package level exports for `within` operator

* Replaced getByTestId queries with getByA11yHint queries in unit tests for `within`

* Added `within` section to API.md

* Updated README.md regarding `within` operator

* Update website/docs/API.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-14 12:51:19 +02:00
Maciej Jastrzebski 51bd418ba7 docs: added warnings for *ByTestId queries (#305)
* Added usage notes for ByTestId queries

* Update website/docs/Queries.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* Update website/docs/Queries.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-14 10:26:06 +02:00
Kenneth Kwakye-Gyamfi 58055d8998 docs: migrate to Docusaurus v2 (#299)
* Migration to Docusaurus v2.0.0

* update lock file

* add algolia search

* update GH Pages deploy

* make sidebar non-collapsible for now

* update theme colors

* ignore docusaurus-specific import aliases, remove home-container class

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-13 10:28:32 +02:00
Michał Pierzchała 16718c3d6c chore: bump React Native to 0.63 RC (#301) 2020-05-12 13:45:41 +02:00
Michał Pierzchała 298a13831b chore: upgrade Jest deps to 26 (#302) 2020-05-12 13:34:32 +02:00
Maria Marchenkova c8395ef947 feat: query nested text nodes (#293)
* feat: query nested text nodes

* test on nested text nodes

* test on custom component, refactor

* remove comments

* move textContent out of module scope, fixup children check

Co-authored-by: Mariia Marchenkova <marchewka@Mariias-MacBook-Pro.local>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-11 19:13:15 +02:00
Kenneth Kwakye-Gyamfi 53dc00acc9 Redux Integration (#292)
* Redux example

* Reviews implemented

* Redux integration example

* Update docs/ReduxIntegration.md

* Update docs/ReduxIntegration.md

* Resolution of reviews put in by @thymikee

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-08 16:49:49 +02:00
Kenneth Kwakye-Gyamfi 3e125d20f4 Remove use of getByTestID in documentation and tests (#294)
* Switched most tests from using test IDs

* Docs updated to use alternatives
2020-05-08 16:37:28 +02:00
Kenneth Kwakye-Gyamfi ae3d4af370 docs: add Redux example (#291)
* Redux example

* Reviews implemented
2020-05-05 10:51:29 +02:00
Jeroen Vannevel 83b28b227d fix: *ByText would call toString() on objects and only match on [object Object] (#290) 2020-05-01 13:54:12 +02:00
Michał Pierzchała 360a53d533 v1.13.2 v1.13.2 2020-04-24 12:25:27 +02:00
Michał Pierzchała 1f6bc249f2 docs: fix readme example (#288) 2020-04-24 12:24:57 +02:00
Michał Pierzchała 68bfe6343c v1.13.1 v1.13.1 2020-04-24 12:22:13 +02:00
Kenneth Kwakye-Gyamfi 0b00faeef7 Include links to the repository and the homepage (#287) 2020-04-24 12:15:29 +02:00
Kenneth Kwakye-Gyamfi 95b4889fe9 docs: add example of testing React Navigation (#277)
* Proof of concept -  CodeSandbox embed

* Prettier fix

* Moved examples below API Reference

* Created the examples directory

Includes react-navigation example

* Article on React Navigation

* Specify rootDir for testing

Prevents CI to run example tests

* remove jest-transform-stub and identity-obj-proxy, add transformIgnorePatterns

* update docs

* rearrange

* remove non-essential files

* rename Navigation -> AppNavigator

* reword comment

* add links and explanations

* remove index file, because it's not an app anyway

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-04-24 11:08:52 +02:00
Michał Pierzchała 1efb814730 docs: fix a link to example (#286) 2020-04-23 16:33:35 +02:00
Michał Pierzchała 61a83e9bb7 chore: update GettingStarted example with something you can run (#284) 2020-04-23 16:27:01 +02:00
Michał Pierzchała b0e5e1baea chore: regenerate lock files to remove vulnerability warnings (#285) 2020-04-23 16:24:06 +02:00
Jesse R Weigel c0e557c44b Fix unclear sentence and misuse of word 'stand' (#278)
* Fix unclear sentence and misuse of word 'stand'

This sentence was not very clear. Also, the word 'stand' was used, but I think the word 'understand' was what was intended.
The sentence has been updated to convey what I think was the intended meaning.

* Update docs/GettingStarted.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-04-21 20:42:05 +02:00
Michał Pierzchała d8fd1543e4 chore: bump RN to 0.62 (#273)
* chore: bump RN to 0.62

* disable accessibilityStates tests; fixups
2020-04-20 11:40:09 +02:00
Kacper Wiszczuk 0ecf788171 chore: fix inconsistent flow fails on CI (#269)
* chore: fix inconsistent flow fails on CI

* Make it faster
2020-03-18 20:02:12 +01:00
Kacper Wiszczuk b67227d4b4 chore: lib upgrades (#268)
* Update libs

* Upgrade Typescript

* use flowconfig from 0.61

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-03-18 20:00:31 +01:00