Skip to content

Commit 4b6379d

Browse files
ariesjiaKent C. Dodds
authored andcommitted
docs: add riot ecosystem plugin (testing-library#296)
* docs: add riot ecosystem plugin * docs: remove unnecessary async & add auto cleanup
1 parent 40af413 commit 4b6379d

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
id: ecosystem-riot-testing-library
3+
title: riot-testing-library
4+
---
5+
6+
[`riot-testing-library`][gh] builds on top of [DOM Testing Library](https://github.com/testing-library/dom-testing-library) by adding APIs for working with [Riot.js](https://riot.js.org/) components.
7+
8+
```
9+
npm install --save-dev riot-testing-library
10+
```
11+
12+
```javascript
13+
import render, { fireEvent } from 'riot-testing-library'
14+
import TestTag from './test.tag'
15+
16+
test('should show count text when rendered', () => {
17+
const { queryByTestId } = render(TestTag, {count: 10});
18+
expect(queryByTestId('count').textContent).toBe("10");
19+
})
20+
21+
test('should add count when click add button text', () => {
22+
const { queryByTestId } = render(TestTag, {count: 1});
23+
expect(queryByTestId('count').textContent).toBe("1");
24+
fireEvent.click(queryByTestId('button'))
25+
expect(queryByTestId('count').textContent).toBe("2");
26+
})
27+
```
28+
29+
30+
- [riot-testing-library on GitHub][gh]
31+
32+
[gh]: https://github.com/ariesjia/riot-testing-library

website/sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@
110110
"ecosystem-bs-jest-dom",
111111
"ecosystem-jest-native",
112112
"ecosystem-react-select-event",
113-
"ecosystem-eslint-plugin-testing-library"
113+
"ecosystem-eslint-plugin-testing-library",
114+
"ecosystem-riot-testing-library"
114115
],
115116
"Help": ["faq", "learning", "contributing"]
116117
},

0 commit comments

Comments
 (0)