mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
28 lines
758 B
JavaScript
28 lines
758 B
JavaScript
const { resolvePath } = require('../../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');
|
|
});
|
|
});
|
|
});
|