This can be achieved using 
if (path.resolve(testDataPath) === testDataPath)