I am trying to use anyNpmPackage
in meteor project on test.
I have done meteor npm install anyNpmPackage
In my package.js i have
Package.onTest(function(api) {
api.use([
'anyNpmPackage'
]);
api.addFiles('tests/server/methods.js', 'server');
});
Now anyNpmPackage
uses jsonpath
internally
On of the line of jsonpath
code in grammer.js
is
myModule = fs.readFileSyn`c(require.resolve("../include/module.js"));
And when i do the meteor test
I get error Error: Cannot find module '../include/module.js'
And when i debugged just above that line
console.log(fs.readdirSync('../../'))
the result was [ 'server', 'web.browser' ]
and console.log(__dirname)
was resulting to /node_modules/jsonpath/lib
What i need is that when i do fs.readdirSync it should result into the original files from my codebase from from the temp env directory created under /tmp by meteor.
Any workaround for this issue?