title: How can I mock a third-party nodejs module function using jest with TypeScript?
body: <p>I am trying to mock a function in a third-party node module, specifically the <code>fs.readFileSync()</code> function, using jest. There are quite a few examples out there but I haven't found one which uses TypeScript. I have a simple, hopefully minimal, example at <a href="https://github.com/asmallfurrywombat/jest_typescript_mock_test" rel="nofollow noreferrer">github</a>. This is probably a simple issue for someone familiar with jest.</p>