docsify/test/unit/router-util.test.js

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');
});
});
});