Within a karma test beforeEach) block I would like to access (read) a file from the project directory. However, I do not know how to get access to that directory, since process.cwd() returns the directory the test is running in, which is a random private dir assigned by node or gulp.
How can I find what the project dir is within a running test?
describe.only('convertClaimTypes', function () {
var claimTypes;
before(function () {
var base = process.cwd();
claimTypes = fs.readFileSync(path.join(base, 'build/resources/claimTypes.json'));
claimTypes = JSON.parse(claimTypes);
});
...