diff --git a/__tests__/index.js b/__tests__/index.js
index 84a4de2..6606f5e 100644
--- a/__tests__/index.js
+++ b/__tests__/index.js
@@ -34,14 +34,17 @@ describe("react-progressive-image", () => {
/* eslint-disable no-console */
const _error = console.error;
console.error = jest.fn(() => {});
- expect(() => {
- mount(
-
- Uh oh!
-
- );
- }).toThrow(`ProgressiveImage requires a function as its only child`);
- console.error = _error;
+ try {
+ expect(() => {
+ mount(
+
+ Uh oh!
+
+ );
+ }).toThrow(`ProgressiveImage requires a function as its only child`);
+ } finally {
+ console.error = _error;
+ }
/* eslint-enable no-console */
});