mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
Merge pull request #21518 from storybookjs/norbert/fix-windows-unit-test-pathing-issue
Build: add slash to fix windows test
This commit is contained in:
commit
69bd030e58
@ -1,5 +1,6 @@
|
||||
import path from 'path';
|
||||
import findUp from 'find-up';
|
||||
import slash from 'slash';
|
||||
import { normalizeStoryPath, getProjectRoot } from '../paths';
|
||||
|
||||
jest.mock('find-up');
|
||||
@ -49,7 +50,7 @@ describe('getProjectRoot', () => {
|
||||
name === ('.git' as any) ? '/path/to/root' : undefined
|
||||
);
|
||||
|
||||
expect(getProjectRoot()).toBe('/path/to');
|
||||
expect(slash(getProjectRoot())).toBe('/path/to');
|
||||
});
|
||||
|
||||
it('should return the root directory containing a .svn directory if there is no .git directory', () => {
|
||||
@ -57,7 +58,7 @@ describe('getProjectRoot', () => {
|
||||
name === ('.svn' as any) ? '/path/to/root' : undefined
|
||||
);
|
||||
|
||||
expect(getProjectRoot()).toBe('/path/to');
|
||||
expect(slash(getProjectRoot())).toBe('/path/to');
|
||||
});
|
||||
|
||||
it('should return the root directory containing a .yarn directory if there is no .git or .svn directory', () => {
|
||||
@ -65,6 +66,6 @@ describe('getProjectRoot', () => {
|
||||
name === ('.yarn' as any) ? '/path/to/root' : undefined
|
||||
);
|
||||
|
||||
expect(getProjectRoot()).toBe('/path/to');
|
||||
expect(slash(getProjectRoot())).toBe('/path/to');
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user