mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 22:05:20 +00:00
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] === '[';
|
const b_is_dynamic = b_part[0] === '[';
|
||||||
|
|
||||||
if (a_is_dynamic === b_is_dynamic) {
|
if (a_is_dynamic === b_is_dynamic) {
|
||||||
if (!a_is_dynamic) same = false;
|
if (!a_is_dynamic && a_part !== b_part) same = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ describe('create_routes', () => {
|
|||||||
assert.throws(() => {
|
assert.throws(() => {
|
||||||
create_routes(['[foo].html', '[bar]/index.html']);
|
create_routes(['[foo].html', '[bar]/index.html']);
|
||||||
}, /The \[foo\].html and \[bar\]\/index.html routes clash/);
|
}, /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', () => {
|
it('matches nested routes', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user