1.2.28 • Published 5 years ago
describe-react v1.2.28
describe-react
Write your react tests in JSX
// list.test.js
import React from 'react'
import run, { Describe, Expect, Render, Trigger } from 'describe-react'
// A component with hooks to test
function Counter() {
const [counter, setCounter] = React.useState(0)
function increment() {
setCounter(counter + 1)
}
return (
<button onClick={ increment }>
{ counter }
</button>
)
}
run(() => (
<Describe label="Counter">
<Render>
<Counter />
</Render>
<Expect element="button">
<To have text="0" />
</Expect>
<Trigger event="click" to element="button" />
<Expect element="button">
<To have text="1" />
</Expect>
</Describe>
))jest list.testPASS list.test.js
Quick usage
Expect element="button"
✓ to have text "0"
Trigger
✓ event="click" to element="button"
Expect element="button"
✓ to have text "1"View documentation
1.2.27
5 years ago
1.2.28
5 years ago
1.2.25
5 years ago
1.2.26
5 years ago
1.2.24
5 years ago
1.2.18
6 years ago
1.2.19
6 years ago
1.2.20
6 years ago
1.2.23
6 years ago
1.2.21
6 years ago
1.2.22
6 years ago
1.2.13
6 years ago
1.2.16
6 years ago
1.2.17
6 years ago
1.2.14
6 years ago
1.2.15
6 years ago
1.2.12
6 years ago
1.2.11
6 years ago
1.2.9
6 years ago
1.2.10
6 years ago
1.2.8
6 years ago
1.2.7
6 years ago
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.12
6 years ago
1.0.9
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago