mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
Merge pull request #608 from cudr/preload_return_fix
Don't crash if preload return empty
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<script context="module">
|
||||
export function preload() {}
|
||||
</script>
|
||||
|
||||
<h1>Page loaded</h1>
|
||||
@@ -37,6 +37,15 @@ describe('preloading', function() {
|
||||
assert.equal(await title(), 'true');
|
||||
});
|
||||
|
||||
it('prevent crash if preload return nothing', async () => {
|
||||
await page.goto(`${base}/preload-nothing`);
|
||||
|
||||
await start();
|
||||
await wait(50);
|
||||
|
||||
assert.equal(await title(), 'Page loaded');
|
||||
});
|
||||
|
||||
it('bails on custom classes returned from preload', async () => {
|
||||
await page.goto(`${base}/preload-values/custom-class`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user