Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeyper committed Jan 7, 2021
2 parents 81ce711 + 08d5bb4 commit 1970833
Show file tree
Hide file tree
Showing 30 changed files with 373 additions and 383 deletions.
58 changes: 58 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,64 @@
"contributions": [
"code"
]
},
{
"login": "nobrayner",
"name": "Braydon Hall",
"avatar_url": "https://avatars2.githubusercontent.com/u/40751395?v=4",
"profile": "https://github.com/nobrayner",
"contributions": [
"code"
]
},
{
"login": "JacobMGEvans",
"name": "Jacob M-G Evans",
"avatar_url": "https://avatars1.githubusercontent.com/u/27247160?v=4",
"profile": "https://dev.to/jacobmgevans",
"contributions": [
"code",
"test"
]
},
{
"login": "tigerabrodi",
"name": "Tiger Abrodi",
"avatar_url": "https://avatars1.githubusercontent.com/u/49603590?v=4",
"profile": "https://tigerabrodi.dev/",
"contributions": [
"code",
"test"
]
},
{
"login": "merodiro",
"name": "Amr A.Mohammed",
"avatar_url": "https://avatars1.githubusercontent.com/u/17033502?v=4",
"profile": "https://github.com/merodiro",
"contributions": [
"code",
"test"
]
},
{
"login": "juhanakristian",
"name": "Juhana Jauhiainen",
"avatar_url": "https://avatars1.githubusercontent.com/u/544386?v=4",
"profile": "https://github.com/juhanakristian",
"contributions": [
"code"
]
},
{
"login": "jensmeindertsma",
"name": "Jens Meindertsma",
"avatar_url": "https://avatars3.githubusercontent.com/u/64677517?v=4",
"profile": "https://github.com/jensmeindertsma",
"contributions": [
"code",
"test"
]
}
],
"commitConvention": "none"
Expand Down
11 changes: 9 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"extends": "./node_modules/kcd-scripts/eslint.js",
"extends": ["./node_modules/kcd-scripts/eslint.js"],
"rules": {
"max-lines-per-function": "off",
"no-constant-condition": "off",
"no-await-in-loop": "off",
"no-console": "off",
"import/no-unresolved": "off",
"react-hooks/rules-of-hooks": "off",
"no-console": "off"
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-invalid-void-type": "off"
},
"parserOptions": {
"project": ["./tsconfig.json", "./test/tsconfig.json"]
}
}
5 changes: 0 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ select the added contribution type.
Please make sure to run the tests before you commit your changes. You can do so by running
`npm test`.

### Update Typings

The TypeScript type definitions can be found in the
[DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react-hooks).

## Help needed

Please check out the
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/joshuaellis"><img src="https://avatars0.githubusercontent.com/u/37798644?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Josh</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=joshuaellis" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Goldziher"><img src="https://avatars1.githubusercontent.com/u/30733348?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Na'aman Hirschfeld</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=Goldziher" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/nobrayner"><img src="https://avatars2.githubusercontent.com/u/40751395?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Braydon Hall</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=nobrayner" title="Code">💻</a></td>
<td align="center"><a href="https://dev.to/jacobmgevans"><img src="https://avatars1.githubusercontent.com/u/27247160?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jacob M-G Evans</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=JacobMGEvans" title="Code">💻</a> <a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=JacobMGEvans" title="Tests">⚠️</a></td>
<td align="center"><a href="https://tigerabrodi.dev/"><img src="https://avatars1.githubusercontent.com/u/49603590?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tiger Abrodi</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=tigerabrodi" title="Code">💻</a> <a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=tigerabrodi" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/merodiro"><img src="https://avatars1.githubusercontent.com/u/17033502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amr A.Mohammed</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=merodiro" title="Code">💻</a> <a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=merodiro" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/juhanakristian"><img src="https://avatars1.githubusercontent.com/u/544386?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Juhana Jauhiainen</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=juhanakristian" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/jensmeindertsma"><img src="https://avatars3.githubusercontent.com/u/64677517?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jens Meindertsma</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=jensmeindertsma" title="Code">💻</a> <a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=jensmeindertsma" title="Tests">⚠️</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
Expand Down
25 changes: 0 additions & 25 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,28 +259,3 @@ The maximum amount of time in milliseconds (ms) to wait. By default, no timeout
If this option is set to `true`, any errors that occur while waiting are treated as a failed check.
If this option is set to `false`, any errors that occur while waiting cause the promise to be
rejected. By default, errors are not suppressed for this utility.

### `wait`

_(DEPRECATED, use [`waitFor`](/reference/api#waitfor) instead)_

```js
function wait(callback: function(): boolean|void, options?: {
timeout?: number,
suppressErrors?: boolean
}): Promise<void>
```

Returns a `Promise` that resolves if the provided callback executes without exception and returns a
truthy or `undefined` value. It is safe to use the [`result` of `renderHook`](/reference/api#result)
in the callback to perform assertion or to test values.

#### `timeout`

The maximum amount of time in milliseconds (ms) to wait. By default, no timeout is applied.

#### `suppressErrors`

If this option is set to `true`, any errors that occur while waiting are treated as a failed check.
If this option is set to `false`, any errors that occur while waiting cause the promise to be
rejected. By default, errors are suppressed for this utility.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// eslint-disable-next-line
const { jest: jestConfig } = require('kcd-scripts/config')

module.exports = Object.assign(jestConfig, {
roots: ['<rootDir>/src', '<rootDir>/test'],
testMatch: ['<rootDir>/test/*.js']
testMatch: ['<rootDir>/test/*.(ts|tsx|js)']
})
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0-semantically-released",
"description": "Simple and complete React hooks testing utilities that encourage good testing practices.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"keywords": [
"testing",
"react",
Expand All @@ -27,29 +28,34 @@
"validate": "kcd-scripts validate",
"prepare": "npm run build",
"build": "kcd-scripts build --out-dir lib",
"test": "kcd-scripts test",
"typecheck": "kcd-scripts typecheck",
"lint": "kcd-scripts lint",
"format": "kcd-scripts format",
"coverage": "codecov",
"test": "kcd-scripts test",
"docs:dev": "docz dev",
"docs:build": "docz build",
"contributors:add": "all-contributors add"
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@types/testing-library__react-hooks": "^3.4.0"
"@types/react": ">=16.9.0",
"@types/react-test-renderer": ">=16.9.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"all-contributors-cli": "6.19.0",
"codecov": "3.8.1",
"docz": "2.3.1",
"docz-theme-default": "1.2.0",
"docz-utils": "2.3.0",
"eslint": "7.15.0",
"kcd-scripts": "7.5.3",
"prettier": "^2.2.1",
"react": "17.0.1",
"react-test-renderer": "17.0.1",
"typescript": "4.1.3",
"eslint": "7.17.0"
"typescript": "4.1.3"
},
"peerDependencies": {
"react": ">=16.9.0",
Expand Down
123 changes: 0 additions & 123 deletions src/asyncUtils.js

This file was deleted.

Loading

0 comments on commit 1970833

Please sign in to comment.