Skip to content

Commit a8d9f84

Browse files
tomzohartomzo42
andauthored
feat: get path separator (#97)
Co-authored-by: tomzo42 <tom.zohar@hibob.io>
1 parent 8947a4b commit a8d9f84

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

apps/cli-daemon/src/app/workspace-manager/workspace-manager.controller.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const workspaceManagerMock: WorkspaceManagerServiceMock = {
1313
getHomeDir: jest.fn(),
1414
};
1515

16+
jest.mock('path', () => ({
17+
sep: 'mock-separator',
18+
}));
19+
1620
describe('WorkspaceManagerController', () => {
1721
let controller: WorkspaceManagerController;
1822

@@ -59,4 +63,10 @@ describe('WorkspaceManagerController', () => {
5963
expect(workspaceManagerMock.getHomeDir).toHaveBeenCalled();
6064
});
6165
});
66+
67+
describe('getPathSeparator', () => {
68+
it('should return path separator', () => {
69+
expect(controller.getPathSeparator()).toMatch('mock-separator');
70+
});
71+
});
6272
});

apps/cli-daemon/src/app/workspace-manager/workspace-manager.controller.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path';
2+
13
import {
24
Controller,
35
Get,
@@ -29,4 +31,9 @@ export class WorkspaceManagerController {
2931
public getHomeDirectory(): string {
3032
return this.workspaceManagerService.getHomeDir();
3133
}
34+
35+
@Get('path-sep')
36+
public getPathSeparator(): string {
37+
return path.sep;
38+
}
3239
}

0 commit comments

Comments
 (0)