diff --git a/README.md b/README.md
index c38741a7..fb439350 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,7 @@ when a real user uses it.
* [`toBeInTheDOM`](#tobeinthedom)
* [`toHaveTextContent`](#tohavetextcontent)
* [`toHaveAttribute`](#tohaveattribute)
+ * [`toHaveClass`](#tohaveclass)
* [Custom Jest Matchers - Typescript](#custom-jest-matchers---typescript)
* [`TextMatch`](#textmatch)
* [`query` APIs](#query-apis)
@@ -364,6 +365,25 @@ expect(getByTestId(container, 'ok-button')).not.toHaveAttribute(
// ...
```
+### `toHaveClass`
+
+This allows you to check wether the given element has certain classes within its
+`class` attribute.
+
+```javascript
+// add the custom expect matchers
+import 'dom-testing-library/extend-expect'
+
+// ...
+//
+expect(getByTestId(container, 'delete-button')).toHaveClass('extra')
+expect(getByTestId(container, 'delete-button')).toHaveClass('btn-danger btn')
+expect(getByTestId(container, 'delete-button')).not.toHaveClass('btn-link')
+// ...
+```
+
### Custom Jest Matchers - Typescript
When you use custom Jest Matchers with Typescript, you will need to extend the
diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js
index 39a0eecc..33ff6100 100644
--- a/src/__tests__/element-queries.js
+++ b/src/__tests__/element-queries.js
@@ -150,4 +150,47 @@ test('using jest helpers to check element attributes', () => {
).toThrowError()
})
+test('using jest helpers to check element class names', () => {
+ const {getByTestId} = render(`
+