test(nx-dev): make test pass on windows (#27284)

## Current Behavior
running `nx test nx-dev-ui-markdoc` fails on windows

## Expected Behavior
running `nx test nx-dev-ui-markdoc` pass on windows
This commit is contained in:
robertIsaac 2024-08-05 15:29:56 +03:00 committed by GitHub
parent bd7a2c9214
commit 45fa90f197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { transformImagePath } from './transform-image-path'; import { transformImagePath } from './transform-image-path';
import { join, sep } from 'path';
describe('transformImagePath', () => { describe('transformImagePath', () => {
it('should transform relative paths', () => { it('should transform relative paths', () => {
@ -7,10 +8,14 @@ describe('transformImagePath', () => {
); );
expect(transform('./test.png')).toEqual( expect(transform('./test.png')).toEqual(
'/documentation/shared/using-nx/test.png' sep + join('documentation', 'shared', 'using-nx', 'test.png')
);
expect(transform('../test.png')).toEqual(
sep + join('documentation', 'shared', 'test.png')
);
expect(transform('../../test.png')).toEqual(
sep + join('documentation', 'test.png')
); );
expect(transform('../test.png')).toEqual('/documentation/shared/test.png');
expect(transform('../../test.png')).toEqual('/documentation/test.png');
}); });
it('should transform absolute paths', () => { it('should transform absolute paths', () => {