forked from docsifyjs/docsify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.test.js
More file actions
32 lines (26 loc) 路 770 Bytes
/
Copy pathutil.test.js
File metadata and controls
32 lines (26 loc) 路 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-disable no-global-assign */
require = require('esm')(
module /* , options */
); /* eslint-disable-line no-global-assign */
const { expect } = require('chai');
const { resolvePath } = require('../../src/core/router/util');
describe('router/util', function() {
it('resolvePath', async function() {
// WHEN
const result = resolvePath('hello.md');
// THEN
expect(result).equal('/hello.md');
});
it('resolvePath with dot', async function() {
// WHEN
const result = resolvePath('./hello.md');
// THEN
expect(result).equal('/hello.md');
});
it('resolvePath with two dots', async function() {
// WHEN
const result = resolvePath('test/../hello.md');
// THEN
expect(result).equal('/hello.md');
});
});