normalize root to work on windows

Signed-off-by: Juan Pablo Garcia Ripa <juanpablog@spotify.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2022-12-28 16:04:49 +01:00
parent 2956b865ec
commit d362b4c989
+2 -2
View File
@@ -15,11 +15,11 @@
*/
import mockFs from 'mock-fs';
import { resolve as resolvePath, join as joinPath } from 'path';
import { resolve as resolvePath, join as joinPath, normalize } from 'path';
import { resolvePackagePath, paths, findPackageDirs } from './paths';
describe('paths', () => {
jest.spyOn(paths, 'targetRoot', 'get').mockReturnValue('/root');
jest.spyOn(paths, 'targetRoot', 'get').mockReturnValue(normalize('/root'));
jest.spyOn(paths, 'resolveTargetRoot').mockImplementation((...path) => {
return resolvePath('/root', ...path);
});