fix(v2): windows compatibility (#1353)

This commit is contained in:
Endilie Yacop Sucipto 2019-04-10 15:30:30 +07:00 committed by GitHub
parent 15bc33df50
commit 5872e2dd91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 3 deletions

View file

@ -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',