---
title: "Thomas Obermüller (@thmsobrmlr) | Hashnode"
description: "Thomas Obermüller (@thmsobrmlr) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@thmsobrmlr"
---

@thmsobrmlr

# Thomas Obermüller

@thmsobrmlr · Joined June 2021

### [Mocking console.log with jest](https://thmsobrmlr.hashnode.dev/mocking-consolelog-with-jest?utm_source=hashnode&utm_medium=feed)

describe("outer", () => { describe("inner", () => { let spy: jest.SpyInstance; beforeAll(() => { spy = jest.spyOn(global.console, "log").mockImplementation(); }); afterAll(() => { spy.mockRestore(); }); it("do...

1 min read · [thmsobrmlr.hashnode.dev](https://thmsobrmlr.hashnode.dev/mocking-consolelog-with-jest?utm_source=hashnode&utm_medium=feed)

[Jun 6, 2021](https://hashnode.com/posts/mocking-consolelog-with-jest/60bd5190e36d51141c95d199)

### [Using jest toThrow with async / await](https://thmsobrmlr.hashnode.dev/using-jest-tothrow-with-async-await?utm_source=hashnode&utm_medium=feed)

Instead of it("doesn't work", async () => { const fn = async () => { throw new Error(); }; expect(await fn()).toThrow(); }); Use it("does work", async () => { const fn = async () => { throw new Error(); }; await expect(fn()).r...

1 min read · [thmsobrmlr.hashnode.dev](https://thmsobrmlr.hashnode.dev/using-jest-tothrow-with-async-await?utm_source=hashnode&utm_medium=feed)

[Jun 6, 2021](https://hashnode.com/posts/using-jest-tothrow-with-async-await/60bd38c0e36d51141c95d0a5)
