mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 12:04:39 +00:00
more tests
This commit is contained in:
@@ -135,7 +135,6 @@ describe.only('create_routes', () => {
|
||||
it('fails on clashes', () => {
|
||||
assert.throws(() => {
|
||||
const { pages } = create_routes(path.join(__dirname, 'samples/clash-pages'));
|
||||
console.log(pages);
|
||||
}, /The \[bar\]\/index\.html and \[foo\]\.html pages clash/);
|
||||
|
||||
assert.throws(() => {
|
||||
@@ -143,4 +142,16 @@ describe.only('create_routes', () => {
|
||||
console.log(server_routes);
|
||||
}, /The \[bar\]\/index\.js and \[foo\]\.js routes clash/);
|
||||
});
|
||||
|
||||
it('fails if dynamic params are not separated', () => {
|
||||
assert.throws(() => {
|
||||
create_routes(path.join(__dirname, 'samples/invalid-params'));
|
||||
}, /Invalid route \[foo\]\[bar\]\.js — parameters must be separated/);
|
||||
});
|
||||
|
||||
it('errors when trying to use reserved characters in route regexp', () => {
|
||||
assert.throws(() => {
|
||||
create_routes(path.join(__dirname, 'samples/invalid-qualifier'));
|
||||
}, /Invalid route \[foo\(\[a-z\]\[0-9\]\?\)\].js — cannot use \(, \), \? or \: in route qualifiers/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user