Skip to content

Commit b175403

Browse files
authored
Create README.md
1 parent a80a4da commit b175403

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# eventually
2+
3+
```go
4+
// Must will keep trying until it succeeds or the test times out or reaches
5+
// max attempts. If it fails, it will call t.Fatalf.
6+
eventually.Must(t, func(t testing.TB) {
7+
t.Fatal("but keep trying")
8+
}, eventually.WithMaxAttempts(10))
9+
10+
// Should will keep trying until it succeeds or the test times out or reaches
11+
// max attempts. If it fails, it will call t.Errorf.
12+
eventually.Should(t, func(t testing.TB) {
13+
t.Fatal("but keep trying")
14+
}, eventually.WithTimeout(10*time.Second), eventually.WithInterval(1*time.Second))
15+
```
16+
17+
## TODO
18+
- [ ] Support `Cleanup`
19+
- [ ] Support `Skip`?
20+
- [ ] Add documentation

0 commit comments

Comments
 (0)