Improve testing suite

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2022-03-24 15:05:15 +01:00
parent 6f2f8c454f
commit 286cb1cd21
44 changed files with 2550 additions and 482 deletions
+7
View File
@@ -0,0 +1,7 @@
// A simple mock for some HTMLCanvasElement functions to run in a node env.
HTMLCanvasElement.prototype.getContext = () => ({
fillRect: () => null
});
HTMLCanvasElement.prototype.toDataURL = () => null;
+9
View File
@@ -0,0 +1,9 @@
/* eslint-disable no-undef */
import fetch from 'node-fetch';
if (! globalThis.fetch) {
globalThis.fetch = fetch;
globalThis.Headers = fetch.Headers;
globalThis.Request = fetch.Request;
globalThis.Response = fetch.Response;
}