Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
failing tests for #312
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jul 23, 2018
1 parent 39eb3be commit f8c731c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 38 deletions.
20 changes: 0 additions & 20 deletions test/app/routes/[x]/_layout.html

This file was deleted.

File renamed without changes.
2 changes: 0 additions & 2 deletions test/common/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ function run({ mode, basepath = '' }) {
.evaluate(() => document.querySelector('#sapper').textContent)
.then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [
'x: foo 1',
'y: bar 1',
'z: baz 1'
]);
Expand All @@ -642,7 +641,6 @@ function run({ mode, basepath = '' }) {
})
.then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [
'x: foo 1',
'y: bar 1',
'z: qux 2'
]);
Expand Down
22 changes: 6 additions & 16 deletions test/unit/create_routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ const path = require('path');
const assert = require('assert');
const { create_routes } = require('../../../dist/core.ts.js');


const _default_layout = {
default: true,
name: '_default_layout',
file: null
};

describe('create_routes', () => {
it('creates routes', () => {
const { components, pages, server_routes } = create_routes(path.join(__dirname, 'samples/basic'));
Expand All @@ -21,7 +14,6 @@ describe('create_routes', () => {
assert.deepEqual(components, [
index,
about,
_default_layout,
blog,
blog_$slug
]);
Expand All @@ -44,15 +36,13 @@ describe('create_routes', () => {
{
pattern: /^\/blog\/?$/,
parts: [
{ component: _default_layout, params: [] },
{ component: blog, params: [] }
]
},

{
pattern: /^\/blog\/([^\/]+?)\/?$/,
parts: [
{ component: _default_layout, params: [] },
{ component: blog_$slug, params: ['slug'] }
]
}
Expand Down Expand Up @@ -113,12 +103,12 @@ describe('create_routes', () => {
assert.deepEqual(pages.map(p => p.parts.map(part => part.component.file)), [
['index.html'],
['about.html'],
[_default_layout.file, 'post/index.html'],
[_default_layout.file, 'post/bar.html'],
[_default_layout.file, 'post/foo.html'],
[_default_layout.file, 'post/f[xx].html'],
[_default_layout.file, 'post/[id([0-9-a-z]{3,})].html'],
[_default_layout.file, 'post/[id].html'],
['post/index.html'],
['post/bar.html'],
['post/foo.html'],
['post/f[xx].html'],
['post/[id([0-9-a-z]{3,})].html'],
['post/[id].html'],
['[wildcard].html']
]);
});
Expand Down

0 comments on commit f8c731c

Please sign in to comment.