Skip to content

Commit 8b418c4

Browse files
committed
Allow running run-tests script from any cwd
'node website/run-tests.mjs' tries to load node_modules from the wrong directory. Jasmine also looks for tests in the wrong directory. Fix this by making Jasmine look in the website directory for specs.
1 parent 52ed893 commit 8b418c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

website/run-tests.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
import Jasmine from "jasmine";
55
import colors from "colors";
66
import fs from "fs";
7+
import path from "path";
8+
import url from "url";
9+
10+
let __filename = url.fileURLToPath(import.meta.url);
11+
let __dirname = path.dirname(__filename);
712

813
function main() {
914
let jasmine = new Jasmine();
1015
jasmine.loadConfig({
16+
spec_dir: path.relative("", __dirname),
1117
spec_files: ["!node_modules/**", "**/test-*.mjs"],
1218
stopSpecOnExpectationFailure: true,
1319
random: false,

0 commit comments

Comments
 (0)