diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6a9fdf42f..bbfde04f67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: timeout-minutes: 15 strategy: matrix: - node-version: [8, 10, 12, 14] + node-version: [8, 10, 12, 14, 16] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 diff --git a/src/compiler/compile/render_ssr/handlers/AwaitBlock.ts b/src/compiler/compile/render_ssr/handlers/AwaitBlock.ts index 6a62f872bb..e09abc817c 100644 --- a/src/compiler/compile/render_ssr/handlers/AwaitBlock.ts +++ b/src/compiler/compile/render_ssr/handlers/AwaitBlock.ts @@ -13,7 +13,10 @@ export default function(node: AwaitBlock, renderer: Renderer, options: RenderOpt renderer.add_expression(x` function(__value) { - if (@is_promise(__value)) return ${pending}; + if (@is_promise(__value)) { + __value.then(null, @noop); + return ${pending}; + } return (function(${node.then_node ? node.then_node : ''}) { return ${then}; }(__value)); }(${node.expression.node}) `); diff --git a/test/hydration/index.ts b/test/hydration/index.ts index 2eefee3fac..f3e2c9ea0a 100644 --- a/test/hydration/index.ts +++ b/test/hydration/index.ts @@ -52,6 +52,7 @@ describe('hydration', () => { const cwd = path.resolve(`${__dirname}/samples/${dir}`); compileOptions = config.compileOptions || {}; + compileOptions.accessors = 'accessors' in config ? config.accessors : true; const window = env(); diff --git a/test/hydration/samples/event-handler/main.svelte b/test/hydration/samples/event-handler/main.svelte index 3d1a05ed3e..ca2b21e4b1 100644 --- a/test/hydration/samples/event-handler/main.svelte +++ b/test/hydration/samples/event-handler/main.svelte @@ -1,9 +1,9 @@ {#if clicked}

clicked!

-{/if} \ No newline at end of file +{/if} diff --git a/test/runtime/index.ts b/test/runtime/index.ts index ff6d1039d3..e777196ae2 100644 --- a/test/runtime/index.ts +++ b/test/runtime/index.ts @@ -25,12 +25,13 @@ let compile = null; const sveltePath = process.cwd().split('\\').join('/'); let unhandled_rejection = false; -process.on('unhandledRejection', err => { +function unhandledRejection_handler(err) { unhandled_rejection = err; -}); +} describe('runtime', () => { before(() => { + process.on('unhandledRejection', unhandledRejection_handler); svelte = loadSvelte(false); svelte$ = loadSvelte(true); @@ -46,6 +47,7 @@ describe('runtime', () => { return setupHtmlEqual(); }); + after(() => process.removeListener('unhandledRejection', unhandledRejection_handler)); const failed = new Set();