mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-22 15:15:19 +00:00
update test
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
preload({ params, query }) {
|
preload({ params, query }) {
|
||||||
return fetch(`/api/blog`).then(r => r.json()).then(posts => {
|
return fetch(`/api/blog/contents`).then(r => r.json()).then(posts => {
|
||||||
return { posts };
|
return { posts };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,34 +334,24 @@ function run(env) {
|
|||||||
// Pages that should show up in the extraction directory.
|
// Pages that should show up in the extraction directory.
|
||||||
const expectedPages = [
|
const expectedPages = [
|
||||||
'index.html',
|
'index.html',
|
||||||
'api/index.html',
|
|
||||||
|
|
||||||
'about/index.html',
|
'about/index.html',
|
||||||
'api/about/index.html',
|
|
||||||
|
|
||||||
'slow-preload/index.html',
|
'slow-preload/index.html',
|
||||||
'api/slow-preload/index.html',
|
|
||||||
|
|
||||||
'blog/index.html',
|
'blog/index.html',
|
||||||
'api/blog/index.html',
|
|
||||||
|
|
||||||
'blog/a-very-long-post/index.html',
|
'blog/a-very-long-post/index.html',
|
||||||
'api/blog/a-very-long-post/index.html',
|
|
||||||
|
|
||||||
'blog/how-can-i-get-involved/index.html',
|
'blog/how-can-i-get-involved/index.html',
|
||||||
'api/blog/how-can-i-get-involved/index.html',
|
|
||||||
|
|
||||||
'blog/how-is-sapper-different-from-next/index.html',
|
'blog/how-is-sapper-different-from-next/index.html',
|
||||||
'api/blog/how-is-sapper-different-from-next/index.html',
|
|
||||||
|
|
||||||
'blog/how-to-use-sapper/index.html',
|
'blog/how-to-use-sapper/index.html',
|
||||||
'api/blog/how-to-use-sapper/index.html',
|
|
||||||
|
|
||||||
'blog/what-is-sapper/index.html',
|
'blog/what-is-sapper/index.html',
|
||||||
'api/blog/what-is-sapper/index.html',
|
|
||||||
|
|
||||||
'blog/why-the-name/index.html',
|
'blog/why-the-name/index.html',
|
||||||
'api/blog/why-the-name/index.html',
|
|
||||||
|
'api/blog/contents',
|
||||||
|
'api/blog/a-very-long-post',
|
||||||
|
'api/blog/how-can-i-get-involved',
|
||||||
|
'api/blog/how-is-sapper-different-from-next',
|
||||||
|
'api/blog/how-to-use-sapper',
|
||||||
|
'api/blog/what-is-sapper',
|
||||||
|
'api/blog/why-the-name',
|
||||||
|
|
||||||
'favicon.png',
|
'favicon.png',
|
||||||
'global.css',
|
'global.css',
|
||||||
@@ -408,12 +398,19 @@ function run(env) {
|
|||||||
|
|
||||||
function exec(cmd) {
|
function exec(cmd) {
|
||||||
return new Promise((fulfil, reject) => {
|
return new Promise((fulfil, reject) => {
|
||||||
require('child_process').exec(cmd, (err, stdout, stderr) => {
|
const parts = cmd.split(' ');
|
||||||
process.stdout.write(stdout);
|
const proc = require('child_process').spawn(parts.shift(), parts);
|
||||||
process.stderr.write(stderr);
|
|
||||||
|
|
||||||
if (err) return reject(err);
|
proc.stdout.on('data', data => {
|
||||||
fulfil();
|
process.stdout.write(data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
proc.stderr.on('data', data => {
|
||||||
|
process.stderr.write(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
proc.on('error', reject);
|
||||||
|
|
||||||
|
proc.on('close', () => fulfil());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user