docsify/test/unit/router-util.test.js
2020-10-25 23:05:16 -05:00

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