How to fix ReferenceError: fetch is not defined
Error encountered when testing async function.
Add
const fetch = require('node-fetch')
at the top of the .js file containing the class and the corresponding test file.
Previous post:
Node - Hide API Key
Next post:
JavaScript - Async Await
Discussion