mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
Merge pull request #96 from mrkishi/master
Identify js and html route clashes
This commit is contained in:
@@ -78,7 +78,7 @@ module.exports = function create_matchers(files) {
|
||||
const b_is_dynamic = b_part[0] === '[';
|
||||
|
||||
if (a_is_dynamic === b_is_dynamic) {
|
||||
if (!a_is_dynamic) same = false;
|
||||
if (!a_is_dynamic && a_part !== b_part) same = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,10 @@ describe('create_routes', () => {
|
||||
assert.throws(() => {
|
||||
create_routes(['[foo].html', '[bar]/index.html']);
|
||||
}, /The \[foo\].html and \[bar\]\/index.html routes clash/);
|
||||
|
||||
assert.throws(() => {
|
||||
create_routes(['foo.html', 'foo.js']);
|
||||
}, /The foo.html and foo.js routes clash/);
|
||||
});
|
||||
|
||||
it('matches nested routes', () => {
|
||||
|
||||
Reference in New Issue
Block a user