WiserSolutions/quadro

Using something else then require.main.filename

rudovjan opened this issue · 2 comments

static async appDir() {
   return this.getPackageRootDir(require.main.filename)
}

Because we expect that we run / test our apps using
node app.js


But if we run let say
mocha ./node_modules/quadro/lib/test/independent_test_loader.js

require.main.file is mocha directory

Do we have ideas how to make it universal?

Solved by

require.main.filename = require.main.filename.replace('/node_modules/mocha/bin/_mocha', '')

in independent_test_loader.js

Resolved by #195