Skip to content

Commit d946e3c

Browse files
test: run test against multiple versions of React (#663)
* Test against multiple versions of React * add to contributors * chore(scripts): add extra install scripts for other react versions Co-authored-by: Michael Peyper <mpeyper7@gmail.com>
1 parent ea92648 commit d946e3c

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.all-contributorsrc

+9
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,15 @@
567567
"review"
568568
]
569569
},
570+
{
571+
"login": "snowystinger",
572+
"name": "Robert Snow",
573+
"avatar_url": "https://avatars.githubusercontent.com/u/698229?v=4",
574+
"profile": "https://github.com/snowystinger",
575+
"contributions": [
576+
"test"
577+
]
578+
},
570579
{
571580
"login": "chris110408",
572581
"name": "Chris Chen",

.github/workflows/validate.yml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
node: [12.13, 12, 14, 16]
20+
react: [16.9.0, ^16, ^17]
2021
runs-on: ubuntu-latest
2122
steps:
2223
- name: 🛑 Cancel Previous Runs
@@ -37,6 +38,9 @@ jobs:
3738
env:
3839
HUSKY_SKIP_INSTALL: true
3940

41+
- name: Use React version
42+
run: npm install --save-dev react@"${{ matrix.react }}" react-dom@"${{ matrix.react }}" react-test-renderer@"${{ matrix.react }}"
43+
4044
- name: ▶️ Run validate script
4145
run: npm run validate
4246

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
246246
<td align="center"><a href="https://matan.io"><img src="https://avatars.githubusercontent.com/u/12711091?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matan Borenkraout</b></sub></a><br /><a href="#maintenance-MatanBobi" title="Maintenance">🚧</a></td>
247247
<td align="center"><a href="https://github.com/andyrooger"><img src="https://avatars.githubusercontent.com/u/420834?v=4?s=100" width="100px;" alt=""/><br /><sub><b>andyrooger</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=andyrooger" title="Code">💻</a></td>
248248
<td align="center"><a href="https://github.com/bdwain"><img src="https://avatars.githubusercontent.com/u/3982094?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bryan Wain</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/issues?q=author%3Abdwain" title="Bug reports">🐛</a> <a href="https://github.com/testing-library/react-hooks-testing-library/pulls?q=is%3Apr+reviewed-by%3Abdwain" title="Reviewed Pull Requests">👀</a></td>
249+
<td align="center"><a href="https://github.com/snowystinger"><img src="https://avatars.githubusercontent.com/u/698229?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robert Snow</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=snowystinger" title="Tests">⚠️</a></td>
249250
<td align="center"><a href="https://github.com/chris110408"><img src="https://avatars.githubusercontent.com/u/10645051?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Chris Chen</b></sub></a><br /><a href="https://github.com/testing-library/react-hooks-testing-library/commits?author=chris110408" title="Tests">⚠️</a></td>
250251
</tr>
251252
</table>

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"scripts": {
3434
"setup": "npm install && npm run validate -s",
3535
"validate": "kcd-scripts validate",
36-
"prepare": "npm run build",
3736
"build": "kcd-scripts build --out-dir lib && npm run generate:submodules",
3837
"generate:submodules": "ts-node scripts/generate-submodules.ts",
3938
"test": "kcd-scripts test",
@@ -43,7 +42,10 @@
4342
"coverage": "codecov",
4443
"docs:dev": "docz dev",
4544
"docs:build": "docz build",
46-
"contributors:add": "all-contributors add"
45+
"contributors:add": "all-contributors add",
46+
"install:react-16-9": "npm install --no-save react@16.9.0 react-dom@16.9.0 react-test-renderer@16.9.0",
47+
"install:react-16": "npm install --no-save react@^16 react-dom@^16 react-test-renderer@^16",
48+
"install:react-17": "npm install --no-save react@^17 react-dom@^17 react-test-renderer@^17"
4749
},
4850
"dependencies": {
4951
"@babel/runtime": "^7.12.5",

0 commit comments

Comments
 (0)