Skip to content

Commit f968c44

Browse files
committed
Merge branch 'master' into result-history
2 parents 6827eb4 + 33b8e1e commit f968c44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+358
-129
lines changed

.all-contributorsrc

+9
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@
203203
"contributions": [
204204
"doc"
205205
]
206+
},
207+
{
208+
"login": "Goldziher",
209+
"name": "Na'aman Hirschfeld",
210+
"avatar_url": "https://avatars1.githubusercontent.com/u/30733348?v=4",
211+
"profile": "https://github.com/Goldziher",
212+
"contributions": [
213+
"code"
214+
]
206215
}
207216
],
208217
"commitConvention": "none"

.babelrc

-12
This file was deleted.

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
coverage
3+
lib
4+
.docz
5+
site

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./node_modules/kcd-scripts/eslint.js",
3+
"rules": {
4+
"max-lines-per-function": "off",
5+
"no-constant-condition": "off",
6+
"no-await-in-loop": "off",
7+
"react-hooks/rules-of-hooks": "off",
8+
"no-console": "off"
9+
}
10+
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/---feature-request.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: "I have a suggestion (and might want to implement myself \U0001F642)!"
44
title: ''
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
<!--

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# config options: https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-and-disabling-version-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "npm"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"

.github/workflows/validate.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: validate
2+
on:
3+
push:
4+
branches:
5+
- '+([0-9])?(.{+([0-9]),x}).x'
6+
- 'master'
7+
- 'main'
8+
- 'next'
9+
- 'next-major'
10+
- 'beta'
11+
- 'alpha'
12+
- '!all-contributors/**'
13+
pull_request: {}
14+
jobs:
15+
main:
16+
# ignore all-contributors PRs
17+
if: ${{ !contains(github.head_ref, 'all-contributors') }}
18+
strategy:
19+
matrix:
20+
node: [10.13, 12, 14, 15]
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: 🛑 Cancel Previous Runs
24+
uses: styfle/[email protected]
25+
with:
26+
access_token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: ⬇️ Checkout repo
29+
uses: actions/checkout@v2
30+
31+
- name: ⎔ Setup node
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: ${{ matrix.node }}
35+
36+
- name: 📥 Download deps
37+
uses: bahmutov/npm-install@v1
38+
with:
39+
useLockFile: false
40+
env:
41+
HUSKY_SKIP_INSTALL: true
42+
43+
- name: ▶️ Run validate script
44+
run: npm run validate
45+
46+
- name: ⬆️ Upload coverage report
47+
uses: codecov/codecov-action@v1
48+
49+
release:
50+
needs: main
51+
runs-on: ubuntu-latest
52+
if:
53+
${{ github.repository == 'testing-library/react-hooks-testing-library' &&
54+
contains('refs/heads/master,refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
55+
github.ref) && github.event_name == 'push' }}
56+
steps:
57+
- name: 🛑 Cancel Previous Runs
58+
uses: styfle/[email protected]
59+
with:
60+
access_token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: ⬇️ Checkout repo
63+
uses: actions/checkout@v2
64+
65+
- name: ⎔ Setup node
66+
uses: actions/setup-node@v1
67+
with:
68+
node-version: 14
69+
70+
- name: 📥 Download deps
71+
uses: bahmutov/npm-install@v1
72+
with:
73+
useLockFile: false
74+
env:
75+
HUSKY_SKIP_INSTALL: true
76+
77+
- name: 🏗 Run build script
78+
run: npm run build
79+
80+
- name: 🚀 Release
81+
uses: cycjimmy/semantic-release-action@v2
82+
with:
83+
semantic_version: 17
84+
branches: |
85+
[
86+
'+([0-9])?(.{+([0-9]),x}).x',
87+
'master',
88+
'main',
89+
'next',
90+
'next-major',
91+
{name: 'beta', prerelease: true},
92+
{name: 'alpha', prerelease: true}
93+
]
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.huskyrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('kcd-scripts/husky')

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=false
2+
legacy-peer-deps=true

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
coverage
3+
lib
4+
.docz
5+
site

.prettierrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
printWidth: 100,
3+
semi: false,
4+
singleQuote: true,
5+
arrowParens: 'always',
6+
proseWrap: 'always',
7+
trailingComma: 'none'
8+
}

.travis.yml

-10
This file was deleted.

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CHANGELOG
2+
3+
The changelog is automatically updated using
4+
[semantic-release](https://github.com/semantic-release/semantic-release). You can see it on the
5+
[releases page](../../releases).

CODE_OF_CONDUCT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ further defined and clarified by project maintainers.
4949
## Enforcement
5050

5151
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
52-
the project team at [email protected]. All complaints will be reviewed and investigated and
53-
will result in a response that is deemed necessary and appropriate to the circumstances. The project
54-
team is obligated to maintain confidentiality with regard to the reporter of an incident. Further
55-
details of specific enforcement policies may be posted separately.
52+
the project team at [email protected]. All complaints will be reviewed and investigated and will
53+
result in a response that is deemed necessary and appropriate to the circumstances. The project team
54+
is obligated to maintain confidentiality with regard to the reporter of an incident. Further details
55+
of specific enforcement policies may be posted separately.
5656

5757
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
5858
temporary or permanent repercussions as determined by other members of the project's leadership.

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Please make sure to run the tests before you commit your changes. You can do so
2929

3030
### Update Typings
3131

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

3435
## Help needed
3536

README.md

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
4+
- [react-hooks-testing-library](#react-hooks-testing-library)
5+
- [The problem](#the-problem)
6+
- [The solution](#the-solution)
7+
- [When to use this library](#when-to-use-this-library)
8+
- [When not to use this library](#when-not-to-use-this-library)
9+
- [Example](#example)
10+
- [`useCounter.js`](#usecounterjs)
11+
- [`useCounter.test.js`](#usecountertestjs)
12+
- [Installation](#installation)
13+
- [Peer Dependencies](#peer-dependencies)
14+
- [API](#api)
15+
- [Contributors](#contributors)
16+
- [Issues](#issues)
17+
- [🐛 Bugs](#-bugs)
18+
- [💡 Feature Requests](#-feature-requests)
19+
- [❓ Questions](#-questions)
20+
- [LICENSE](#license)
21+
22+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
23+
124
<div align="center">
225
<h1>react-hooks-testing-library</h1>
326

@@ -6,7 +29,7 @@
629
height="80"
730
width="80"
831
alt="ram"
9-
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/other/ram.png"
32+
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/public/ram.png"
1033
/>
1134
</a>
1235

@@ -20,8 +43,7 @@
2043
<hr />
2144

2245
<!-- prettier-ignore-start -->
23-
24-
[![Build Status](https://img.shields.io/travis/testing-library/react-hooks-testing-library.svg?style=flat-square)](https://travis-ci.org/testing-library/react-hooks-testing-library)
46+
[![Build Status](https://img.shields.io/github/workflow/status/testing-library/react-hooks-testing-library/validate?logo=github&style=flat-square)](https://github.com/testing-library/react-hooks-testing-library/actions?query=workflow%3Avalidate)
2547
[![codecov](https://img.shields.io/codecov/c/github/testing-library/react-hooks-testing-library.svg?style=flat-square)](https://codecov.io/gh/testing-library/react-hooks-testing-library)
2648
[![version](https://img.shields.io/npm/v/@testing-library/react-hooks.svg?style=flat-square)](https://www.npmjs.com/package/@testing-library/react-hooks)
2749
[![downloads](https://img.shields.io/npm/dm/@testing-library/react-hooks.svg?style=flat-square)](http://www.npmtrends.com/@testing-library/react-hooks)
@@ -166,6 +188,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
166188
<td align="center"><a href="https://keiya01.github.io/portfolio"><img src="https://avatars1.githubusercontent.com/u/34934510?v=4?s=100" width="100px;" alt=""/><br /><sub><b>keiya sasaki</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=keiya01" title="Tests">⚠️</a></td>
167189
<td align="center"><a href="https://huchen.dev/"><img src="https://avatars3.githubusercontent.com/u/2078389?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hu Chen</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=huchenme" title="Code">💻</a> <a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=huchenme" title="Documentation">📖</a> <a href="#example-huchenme" title="Examples">💡</a></td>
168190
<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>
191+
<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>
169192
</tr>
170193
</table>
171194

docs/api-reference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ function waitForValueToChange(selector: function(): any, options?: {
236236
}): Promise<void>
237237
```
238238

239-
Returns a `Promise` that resolves if the value returned from the provided selector changes. It is
240-
expected that the [`result` of `renderHook`](/reference/api#result) will be used to select the
241-
value for comparison.
239+
Returns a `Promise` that resolves if the value returned from the provided selector changes. It is
240+
expected that the [`result` of `renderHook`](/reference/api#result) will be used to select the value
241+
for comparison.
242242

243243
#### `interval`
244244

docs/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ route: '/'
1111
height="80"
1212
width="80"
1313
alt="ram"
14-
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/other/ram.png"
14+
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/public/ram.png"
1515
/>
1616
</a>
1717

doczrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
files: '**/*.{md,mdx}',
44
src: 'docs',
55
dest: 'site',
6-
public: './other',
6+
public: './public',
77
ignore: ['CODE_OF_CONDUCT.md', 'CONTRIBUTING.md', 'LICENSE.md'],
88
htmlContext: {
99
favicon: '/public/ram.png'

jest.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const { jest: jestConfig } = require('kcd-scripts/config')
2+
3+
module.exports = Object.assign(jestConfig, {
4+
roots: ['<rootDir>/src', '<rootDir>/test'],
5+
testMatch: ['<rootDir>/test/*.js']
6+
})

other/MAINTAINING.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Maintaining
2+
3+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5+
6+
**Table of Contents**
7+
8+
- [Code of Conduct](#code-of-conduct)
9+
- [Issues](#issues)
10+
- [Pull Requests](#pull-requests)
11+
- [Release](#release)
12+
- [Thanks!](#thanks)
13+
14+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15+
16+
This is documentation for maintainers of this project.
17+
18+
## Code of Conduct
19+
20+
Please review, understand, and be an example of it. Violations of the code of conduct are taken
21+
seriously, even (especially) for maintainers.
22+
23+
## Issues
24+
25+
We want to support and build the community. We do that best by helping people learn to solve their
26+
own problems. We have an issue template and hopefully most folks follow it. If it's not clear what
27+
the issue is, invite them to create a minimal reproduction of what they're trying to accomplish or
28+
the bug they think they've found.
29+
30+
Once it's determined that a code change is necessary, point people to
31+
[makeapullrequest.com](https://makeapullrequest.com) and invite them to make a pull request. If
32+
they're the one who needs the feature, they're the one who can build it. If they need some hand
33+
holding and you have time to lend a hand, please do so. It's an investment into another human being,
34+
and an investment into a potential maintainer.
35+
36+
Remember that this is open source, so the code is not yours, it's ours. If someone needs a change in
37+
the codebase, you don't have to make it happen yourself. Commit as much time to the project as you
38+
want/need to. Nobody can ask any more of you than that.
39+
40+
## Pull Requests
41+
42+
As a maintainer, you're fine to make your branches on the main repo or on your own fork. Either way
43+
is fine.
44+
45+
When we receive a pull request, a GitHub Action is kicked off automatically (see the
46+
`.github/workflows/validate.yml` for what runs in the Action). We avoid merging anything that breaks
47+
the GitHub Action.
48+
49+
Please review PRs and focus on the code rather than the individual. You never know when this is
50+
someone's first ever PR and we want their experience to be as positive as possible, so be uplifting
51+
and constructive.
52+
53+
When you merge the pull request, 99% of the time you should use the
54+
[Squash and merge](https://help.github.com/articles/merging-a-pull-request/) feature. This keeps our
55+
git history clean, but more importantly, this allows us to make any necessary changes to the commit
56+
message so we release what we want to release. See the next section on Releases for more about that.
57+
58+
## Release
59+
60+
Our releases are automatic. They happen whenever code lands into `main`. A GitHub Action gets kicked
61+
off and if it's successful, a tool called
62+
[`semantic-release`](https://github.com/semantic-release/semantic-release) is used to automatically
63+
publish a new release to npm as well as a changelog to GitHub. It is only able to determine the
64+
version and whether a release is necessary by the git commit messages. With this in mind, **please
65+
brush up on [the commit message convention][commit] which drives our releases.**
66+
67+
> One important note about this: Please make sure that commit messages do NOT contain the words
68+
> "BREAKING CHANGE" in them unless we want to push a major version. I've been burned by this more
69+
> than once where someone will include "BREAKING CHANGE: None" and it will end up releasing a new
70+
> major version. Not a huge deal honestly, but kind of annoying...
71+
72+
## Thanks!
73+
74+
Thank you so much for helping to maintain this project!
75+
76+
<!-- prettier-ignore-start -->
77+
[commit]: https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
78+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)