Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Jan 26, 2023
1 parent 47a0a41 commit 1b7d47f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,21 +695,23 @@ e.POST("/fruits").
Status(http.StatusOK)
```

##### Support for alias in a failure message
##### Support for aliases in a failure messages

```go
// when test is failed, assertion in the failure message is Request("GET").Expect().JSON().Array().Empty()
// when the tests fails, assertion path in the failure message is:
// Request("GET").Expect().JSON().Array().Empty()
e.GET("/fruits").
Expect().
Status(http.StatusOK).JSON().Array().Empty()


// add alias named fruits
// assign alias "fruits" to the Array variable
fruits := e.GET("/fruits").
Expect().
Status(http.StatusOK).JSON().Array().Alias("fruits")

// assertion is fruits.Empty()
// assertion path in the failure message is now:
// fruits.Empty()
fruits.Empty()
```

Expand Down

0 comments on commit 1b7d47f

Please sign in to comment.