failing tests for #312

This commit is contained in:
Rich Harris
2018-07-23 14:31:11 -04:00
parent 39eb3be01e
commit f8c731ca21
4 changed files with 6 additions and 38 deletions

View File

@@ -1,20 +0,0 @@
<span>x: {segment} {count}</span>
<svelte:component this={child.component} {...child.props}/>
<script>
import counts from './_counts.js';
export default {
preload() {
return {
count: counts.x += 1
};
},
oncreate() {
this.set({
segment: this.get().params.x
});
}
};
</script>

View File

@@ -629,7 +629,6 @@ function run({ mode, basepath = '' }) {
.evaluate(() => document.querySelector('#sapper').textContent) .evaluate(() => document.querySelector('#sapper').textContent)
.then(text => { .then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [ assert.deepEqual(text.split('\n').filter(Boolean), [
'x: foo 1',
'y: bar 1', 'y: bar 1',
'z: baz 1' 'z: baz 1'
]); ]);
@@ -642,7 +641,6 @@ function run({ mode, basepath = '' }) {
}) })
.then(text => { .then(text => {
assert.deepEqual(text.split('\n').filter(Boolean), [ assert.deepEqual(text.split('\n').filter(Boolean), [
'x: foo 1',
'y: bar 1', 'y: bar 1',
'z: qux 2' 'z: qux 2'
]); ]);

View File

@@ -2,13 +2,6 @@ const path = require('path');
const assert = require('assert'); const assert = require('assert');
const { create_routes } = require('../../../dist/core.ts.js'); const { create_routes } = require('../../../dist/core.ts.js');
const _default_layout = {
default: true,
name: '_default_layout',
file: null
};
describe('create_routes', () => { describe('create_routes', () => {
it('creates routes', () => { it('creates routes', () => {
const { components, pages, server_routes } = create_routes(path.join(__dirname, 'samples/basic')); const { components, pages, server_routes } = create_routes(path.join(__dirname, 'samples/basic'));
@@ -21,7 +14,6 @@ describe('create_routes', () => {
assert.deepEqual(components, [ assert.deepEqual(components, [
index, index,
about, about,
_default_layout,
blog, blog,
blog_$slug blog_$slug
]); ]);
@@ -44,7 +36,6 @@ describe('create_routes', () => {
{ {
pattern: /^\/blog\/?$/, pattern: /^\/blog\/?$/,
parts: [ parts: [
{ component: _default_layout, params: [] },
{ component: blog, params: [] } { component: blog, params: [] }
] ]
}, },
@@ -52,7 +43,6 @@ describe('create_routes', () => {
{ {
pattern: /^\/blog\/([^\/]+?)\/?$/, pattern: /^\/blog\/([^\/]+?)\/?$/,
parts: [ parts: [
{ component: _default_layout, params: [] },
{ component: blog_$slug, params: ['slug'] } { component: blog_$slug, params: ['slug'] }
] ]
} }
@@ -113,12 +103,12 @@ describe('create_routes', () => {
assert.deepEqual(pages.map(p => p.parts.map(part => part.component.file)), [ assert.deepEqual(pages.map(p => p.parts.map(part => part.component.file)), [
['index.html'], ['index.html'],
['about.html'], ['about.html'],
[_default_layout.file, 'post/index.html'], ['post/index.html'],
[_default_layout.file, 'post/bar.html'], ['post/bar.html'],
[_default_layout.file, 'post/foo.html'], ['post/foo.html'],
[_default_layout.file, 'post/f[xx].html'], ['post/f[xx].html'],
[_default_layout.file, 'post/[id([0-9-a-z]{3,})].html'], ['post/[id([0-9-a-z]{3,})].html'],
[_default_layout.file, 'post/[id].html'], ['post/[id].html'],
['[wildcard].html'] ['[wildcard].html']
]); ]);
}); });