Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
| self.addEventListener('install', (e) => { | |
| e.waitUntil( | |
| caches.open("precache").then((cache) => cache.add("/broken.png")) | |
| ); | |
| }); | |
| function isImage(fetchRequest) { | |
| return fetchRequest.method === "GET" && fetchRequest.destination === "image"; | |
| } |
Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
| import axios from "axios"; | |
| const singleton = Symbol(); | |
| const singletonEnforcer = Symbol(); | |
| function readCookie(name) { | |
| const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); | |
| return (match ? decodeURIComponent(match[3]) : null); | |
| } |