mirror of
https://github.com/docsifyjs/docsify.git
synced 2026-01-25 15:23:21 +00:00
28 lines
753 B
JavaScript
28 lines
753 B
JavaScript
import { resolvePath } from '../../src/core/util';
|
|
|
|
// Suite
|
|
// -----------------------------------------------------------------------------
|
|
describe('router/util', () => {
|
|
// resolvePath()
|
|
// ---------------------------------------------------------------------------
|
|
describe('resolvePath()', () => {
|
|
test('resolvePath with filename', () => {
|
|
const result = resolvePath('hello.md');
|
|
|
|
expect(result).toEqual('/hello.md');
|
|
});
|
|
|
|
test('resolvePath with ./', () => {
|
|
const result = resolvePath('./hello.md');
|
|
|
|
expect(result).toEqual('/hello.md');
|
|
});
|
|
|
|
test('resolvePath with ../', () => {
|
|
const result = resolvePath('test/../hello.md');
|
|
|
|
expect(result).toEqual('/hello.md');
|
|
});
|
|
});
|
|
});
|