mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
fix(v2): windows compatibility (#1353)
This commit is contained in:
parent
15bc33df50
commit
5872e2dd91
4 changed files with 37 additions and 3 deletions
|
@ -13,9 +13,23 @@ import {
|
|||
idx,
|
||||
getSubFolder,
|
||||
normalizeUrl,
|
||||
posixPath,
|
||||
} from '../index';
|
||||
|
||||
describe('load utils', () => {
|
||||
test('posixPath', () => {
|
||||
const asserts = {
|
||||
'c:/aaaa\\bbbb': 'c:/aaaa/bbbb',
|
||||
'c:\\aaaa\\bbbb\\★': 'c:\\aaaa\\bbbb\\★',
|
||||
'\\\\?\\c:\\aaaa\\bbbb': '\\\\?\\c:\\aaaa\\bbbb',
|
||||
'c:\\aaaa\\bbbb': 'c:/aaaa/bbbb',
|
||||
'foo\\bar': 'foo/bar',
|
||||
};
|
||||
Object.keys(asserts).forEach(file => {
|
||||
expect(posixPath(file)).toBe(asserts[file]);
|
||||
});
|
||||
});
|
||||
|
||||
test('fileToComponentName', () => {
|
||||
const asserts = {
|
||||
'index.md': 'MDIndex',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue