Using something else then require.main.filename
rudovjan opened this issue · 2 comments
rudovjan commented
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?
rudovjan commented
Solved by
require.main.filename = require.main.filename.replace('/node_modules/mocha/bin/_mocha', '')
in independent_test_loader.js
igorshapiro commented
Resolved by #195