This is not working eventhough relative path given here is correct
before(function(done) {
JSDOM.fromFile('../../../src/main/resources/templates/components/xyz.html')
.then((dom) => {
global.document = dom.window.document;
})
.then(done, done);
});
instead loading directly with absolute path is working fine
before(function(done) {
JSDOM.fromFile('v:/folder_main/src/main/resources/templates/components/xyz.html')
.then((dom) => {
global.document = dom.window.document;
})
.then(done, done);
});
what to do for loading jsdom.fromfile with relative path
Providing the path as below solved the issue for me
JSDOM.fromFile('src/main/resources/templates/components/xyz.html')