diff --git a/README.md b/README.md
index a0b3b97a..9b34ebd6 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ clear to read and to maintain.
+
- [Installation](#installation)
- [Usage](#usage)
- [Custom matchers](#custom-matchers)
@@ -498,7 +499,7 @@ expect(button).toHaveAttribute('type', expect.not.stringContaining('but'))
### `toHaveClass`
```typescript
-toHaveClass(...classNames: string[])
+toHaveClass(...classNames: string[], options?: {exact: boolean})
```
This allows you to check whether the given element has certain classes within
@@ -525,6 +526,9 @@ expect(deleteButton).toHaveClass('btn-danger btn')
expect(deleteButton).toHaveClass('btn-danger', 'btn')
expect(deleteButton).not.toHaveClass('btn-link')
+expect(deleteButton).toHaveClass('btn-danger extra btn', {exact: true}) // to check if the element has EXACTLY a set of classes
+expect(deleteButton).not.toHaveClass('btn-danger extra', {exact: true}) // if it has more than expected it is going to fail
+
expect(noClasses).not.toHaveClass()
```
@@ -940,6 +944,7 @@ Thanks goes to these people ([emoji key][emojis]):
+
This project follows the [all-contributors][all-contributors] specification.
diff --git a/src/__tests__/to-have-class.js b/src/__tests__/to-have-class.js
index 4dd79c33..2e766518 100644
--- a/src/__tests__/to-have-class.js
+++ b/src/__tests__/to-have-class.js
@@ -2,21 +2,25 @@
import {render} from './helpers/test-utils'
+const renderElementWithClasses = () =>
+ render(`
+