Open ksridhar opened 7 months ago
Should be fixed by using the join
method of the node:path
module.
"use strict"
let yaml = require("js-yaml")
let fs = require("fs")
let path = require("path")
function loadTestconfig() {
try {
let filePath = path.join(__dirname, './../testdata/testconfig.yml');
exports.testconfig = yaml.safeLoad(fs.readFileSync(filePath, 'utf8'));
} catch (e) {
console.log(e);
}
Object.freeze(exports.testconfig);
}
exports.loadTestconfig = loadTestconfig;
At https://github.com/nitmws/odrl-wprofile-evaltest1/blob/09210763c3f86eec05b650f3e36aeca8a235cef0/services/configs.js#L7
It works with
'/../testdata/testconfig.yml'
instead of'./../testdata/testconfig.yml'