check runtime errors (#9791)

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/9796/head
Rich Harris 7 months ago committed by GitHub
parent 3b15e32a91
commit bd8f7db754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -305,6 +305,11 @@ async function run_test_variant(
compileOptions
});
}
if (config.runtime_error && !unhandled_rejection) {
unintended_error = true;
assert.fail('Expected a runtime error');
}
} finally {
instance.$destroy();
assert_html_equal(

@ -1,7 +0,0 @@
import { test } from '../../test';
export default test({
runtime_error:
'ERR_SVELTE_TOO_MANY_UPDATES: Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops.',
async test({ assert, target }) {}
});

@ -1,11 +0,0 @@
<script>
const v = { value: 1 };
let s = $state(v)
$effect(() => {
s = v;
s;
});
</script>
{JSON.stringify(s)}
Loading…
Cancel
Save