mirror of https://github.com/jo/docuri.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
439 B
JavaScript
13 lines
439 B
JavaScript
11 years ago
|
var test = require('tap').test;
|
||
|
var docuri = require('..');
|
||
|
|
||
|
test('splat parameter', function(t) {
|
||
|
docuri.route('page/*path', 'page');
|
||
|
|
||
|
t.deepEqual(docuri.page('page/mypage/otherpage'), { path: ['mypage', 'otherpage'] }, 'parsed page has "parts" set to ["mypage","otherpage"]');
|
||
|
t.equal(docuri.page({ path: ['mypage', 'otherpage'] }), 'page/mypage/otherpage', 'stringified page results in "page/mypage/otherpage"');
|
||
|
|
||
|
t.end();
|
||
|
});
|
||
|
|