mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
failing tests for #312
This commit is contained in:
@@ -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>
|
||||
@@ -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'
|
||||
]);
|
||||
@@ -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'
|
||||
]);
|
||||
|
||||
@@ -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'));
|
||||
@@ -21,7 +14,6 @@ describe('create_routes', () => {
|
||||
assert.deepEqual(components, [
|
||||
index,
|
||||
about,
|
||||
_default_layout,
|
||||
blog,
|
||||
blog_$slug
|
||||
]);
|
||||
@@ -44,7 +36,6 @@ describe('create_routes', () => {
|
||||
{
|
||||
pattern: /^\/blog\/?$/,
|
||||
parts: [
|
||||
{ component: _default_layout, params: [] },
|
||||
{ component: blog, params: [] }
|
||||
]
|
||||
},
|
||||
@@ -52,7 +43,6 @@ describe('create_routes', () => {
|
||||
{
|
||||
pattern: /^\/blog\/([^\/]+?)\/?$/,
|
||||
parts: [
|
||||
{ component: _default_layout, params: [] },
|
||||
{ component: blog_$slug, params: ['slug'] }
|
||||
]
|
||||
}
|
||||
@@ -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']
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user