To go back 1 folder level with __dirname with Node.js, we use the path.join
method.
For instance, we write
const path = require("path");
const configFile = path.join(__dirname, "../test/karma.conf.js");
to call path.join
with __dirname
and a string with the path one level above __dirname
with ../
to return a path one level above __dirname
.