fix empty preload

This commit is contained in:
cudr
2019-03-13 15:06:50 +03:00
parent 7be7e1eb9f
commit 6bf3dd04dd
3 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
<script context="module">
export function preload() {}
</script>
<h1>Page loaded</h1>

View File

@@ -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`);