From 7753e5345c711ef0f8623494ff987d7e4c7aaeec Mon Sep 17 00:00:00 2001 From: hackademix Date: Sat, 9 Nov 2024 17:00:59 +0100 Subject: [PATCH] Require explicit call to run tests. --- src/bg/main.js | 5 +++-- src/test/run.js | 4 ++-- src/test/test | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) create mode 120000 src/test/test diff --git a/src/bg/main.js b/src/bg/main.js index 91fb98c..eb5e3ec 100644 --- a/src/bg/main.js +++ b/src/bg/main.js @@ -352,8 +352,9 @@ } }, - test() { - include("/test/run.js"); + async test() { + await include("/test/run.js"); // DEV_ONLY + runTests(); }, async testIC(callbackOrUrl) { diff --git a/src/test/run.js b/src/test/run.js index 775b26a..944e01b 100644 --- a/src/test/run.js +++ b/src/test/run.js @@ -18,7 +18,7 @@ * this program. If not, see . */ -(async () => { +globalThis.runTests = async () => { await include("/nscl/test/Test.js"); Test.include([ "/nscl/test/Policy_test.js", @@ -27,4 +27,4 @@ "XSS", "embargoed/XSS", ]); -})(); +}; diff --git a/src/test/test b/src/test/test new file mode 120000 index 0000000..cf03d95 --- /dev/null +++ b/src/test/test @@ -0,0 +1 @@ +../src/test \ No newline at end of file