Skip to content

Commit 64dcaeb

Browse files
authored
[Chore] Improving contribution guides (#40)
* Added testing guiding * Added issue templates and pull request templates
1 parent d481914 commit 64dcaeb

File tree

6 files changed

+148
-0
lines changed

6 files changed

+148
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: 🐛 Bug report
3+
about: Bugs, missing documentation, or unexpected behavior.
4+
---
5+
6+
- package` version:
7+
- DOM Environment:
8+
9+
### Relevant code or config:
10+
11+
```js
12+
var your => (code) => here;
13+
```
14+
<!-- If there is a repository or codesandbox please also paste in here -->
15+
16+
### What happened:
17+
18+
<!-- Please provide the full error message/screenshots/anything -->
19+
20+
### Reproduction:
21+
22+
<!--
23+
If possible, please create a repository or a code-sandbox that reproduces the issue with the
24+
minimal amount of code possible.
25+
-->
26+
27+
### Problem description:
28+
29+
<!-- Please describe why the current behavior is a problem -->
30+
31+
### Suggested solution:
32+
33+
<!-- Optional -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: 💡 Feature Request
3+
about: I have a suggestion or new component (and might want to implement myself)!
4+
---
5+
6+
### Describe the feature you'd like:
7+
8+
<!--
9+
A clear and concise description of what you want to happen. Add any considered
10+
drawbacks.
11+
-->
12+
13+
### Suggested implementation:
14+
15+
<!-- Optional -->
16+
17+
18+
### Describe alternatives you've considered:
19+
20+
<!--
21+
A clear and concise description of any alternative solutions or features you've
22+
considered.
23+
-->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: ❓ Support Question
3+
about: Get help with any windowed observable package
4+
---
5+
6+
<!-- If you've discovered a bug or would like to propose a change please use one of the other issue templates. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**What**:
2+
3+
<!-- What changes are being made? (What feature/bug is being fixed here?) -->
4+
5+
6+
**Why**:
7+
8+
<!-- Why are these changes necessary? -->
9+
10+
11+
**Checklist**:
12+
13+
<!-- Remove an item if that's irrelevant to your changes -->
14+
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
15+
16+
- [ ] Tests
17+
- [ ] Typescript definitions updated
18+
- [ ] Ready to be merged
19+
20+
<!-- feel free to add additional comments -->

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ Thanks for being willing to contribute!
44

55
**Working on your first Pull Request?** You can learn how from this _free_
66
series [How to Contribute to an Open Source Project on GitHub][egghead]
7+
8+
## Bugs
9+
10+
Bugs are tracked using [Github Issues](https://github.com/luistak/windowed-observable/issues). If you found a bug, please make sure they are not already reported and follow the template in order to create a new report.
11+
12+
## Proposing changes
13+
14+
Create a [new issue](https://github.com/luistak/windowed-observable/issues/new/choose) with the corresponding template in order to propose changes.

TESTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Testing
2+
3+
## Running components tests locally
4+
5+
Run every test in the package
6+
7+
```sh
8+
yarn test:ci
9+
```
10+
11+
Run and watch modified files
12+
13+
Go to `core` or `react` package and run
14+
```sh
15+
yarn test:watch
16+
```
17+
18+
## Technologies
19+
20+
We are using a react test setup with:
21+
22+
- [Jest](https://github.com/facebook/jest)
23+
- [@testing-library](https://github.com/testing-library)
24+
- [react](https://github.com/testing-library/react-testing-library)
25+
- [jest-dom](https://github.com/testing-library/jest-dom)
26+
- [user-event](https://github.com/testing-library/user-event)
27+
28+
And these eslint plugins to ensure best practices
29+
30+
- [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom)
31+
- [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library)
32+
33+
## Principles
34+
35+
> [The more your tests resemble the way your software is used,
36+
> the more confidence they can give you.](https://testing-library.com/docs/guiding-principles)
37+
38+
We are following [@testing-library](https://testing-library.com/docs/guiding-principles) guiding principles, trying to avoid [testing implementation details](https://kentcdodds.com/blog/testing-implementation-details)
39+
40+
## Best practices
41+
42+
- [**Common mistakes using @testing-library**](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library)
43+
- [Avoid nesting](https://kentcdodds.com/blog/avoid-nesting-when-youre-testing)
44+
- [Aha testing](https://kentcdodds.com/blog/aha-testing)
45+
46+
## Recommended extensions
47+
48+
### Jest vscode extension
49+
50+
We recommend using the [official jest extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) to ensure a better testing experience.
51+
52+
But this extension have a specific drawback, there is [no official support for multiple jest-configs](https://github.com/jest-community/vscode-jest/issues/428) or [support for monorepos](https://github.com/jest-community/vscode-jest/issues/129), although we added a `setupTests.ts` that only execute for this extension, each package have their own jest config
53+
54+
### Which query?
55+
56+
[`Which query`](https://github.com/testing-library/which-query) is an awesome extension that aims to enable developers to find a better query when writing tests
57+
58+
There is also [the docs](https://testing-library.com/docs/dom-testing-library/api-queries) and [this article](https://testing-library.com/docs/guide-which-query) that may help you to fint the best query

0 commit comments

Comments
 (0)