summary refs log tree commit diff
path: root/util/tests/setupJest.js
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2022-08-13 02:00:50 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-13 22:00:55 +0200
commit5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce (patch)
tree0a4b23ee96862077b21dea20cf71205709e15f7c /util/tests/setupJest.js
parenttry to update build script (diff)
downloadserver-5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce.tar.xz
restructure to single project
Diffstat (limited to 'util/tests/setupJest.js')
-rw-r--r--util/tests/setupJest.js23
1 files changed, 0 insertions, 23 deletions
diff --git a/util/tests/setupJest.js b/util/tests/setupJest.js
deleted file mode 100644

index 378d72d5..00000000 --- a/util/tests/setupJest.js +++ /dev/null
@@ -1,23 +0,0 @@ -const { performance } = require("perf_hooks"); -const fs = require("fs"); -const path = require("path"); - -// fs.unlinkSync(path.join(__dirname, "..", "database.db")); - -global.expect.extend({ - toBeFasterThan: async (func, target) => { - const start = performance.now(); - let error; - try { - await func(); - } catch (e) { - error = e.toString(); - } - const time = performance.now() - start; - - return { - pass: time < target && !error, - message: () => error || `${func.name} took ${time}ms of maximum ${target}`, - }; - }, -});