diff --git a/test/runtime/samples/error-handling-bubble-to-parent-manually/_config.js b/test/runtime/samples/error-handling-bubble-to-parent-manually/_config.js new file mode 100644 index 0000000000..acd4e2a2f0 --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent-manually/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-bubble-to-parent-manually/child.svelte b/test/runtime/samples/error-handling-bubble-to-parent-manually/child.svelte new file mode 100644 index 0000000000..36cedc81a4 --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent-manually/child.svelte @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-bubble-to-parent-manually/main.svelte b/test/runtime/samples/error-handling-bubble-to-parent-manually/main.svelte new file mode 100644 index 0000000000..5c7caa7dc9 --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent-manually/main.svelte @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-bubble-to-parent/_config.js b/test/runtime/samples/error-handling-bubble-to-parent/_config.js new file mode 100644 index 0000000000..acd4e2a2f0 --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-bubble-to-parent/child.svelte b/test/runtime/samples/error-handling-bubble-to-parent/child.svelte new file mode 100644 index 0000000000..19c327680a --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent/child.svelte @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-bubble-to-parent/main.svelte b/test/runtime/samples/error-handling-bubble-to-parent/main.svelte new file mode 100644 index 0000000000..5c7caa7dc9 --- /dev/null +++ b/test/runtime/samples/error-handling-bubble-to-parent/main.svelte @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-catch-after-error/_config.js b/test/runtime/samples/error-handling-catch-after-error/_config.js new file mode 100644 index 0000000000..acd4e2a2f0 --- /dev/null +++ b/test/runtime/samples/error-handling-catch-after-error/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-catch-after-error/main.svelte b/test/runtime/samples/error-handling-catch-after-error/main.svelte new file mode 100644 index 0000000000..a5fdb5dfd8 --- /dev/null +++ b/test/runtime/samples/error-handling-catch-after-error/main.svelte @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-catch-before-error/_config.js b/test/runtime/samples/error-handling-catch-before-error/_config.js new file mode 100644 index 0000000000..acd4e2a2f0 --- /dev/null +++ b/test/runtime/samples/error-handling-catch-before-error/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-catch-before-error/main.svelte b/test/runtime/samples/error-handling-catch-before-error/main.svelte new file mode 100644 index 0000000000..f005604003 --- /dev/null +++ b/test/runtime/samples/error-handling-catch-before-error/main.svelte @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-event-correct-this/_config.js b/test/runtime/samples/error-handling-event-correct-this/_config.js new file mode 100644 index 0000000000..3f90d0b5cc --- /dev/null +++ b/test/runtime/samples/error-handling-event-correct-this/_config.js @@ -0,0 +1,11 @@ +export default { + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); + + await button.dispatchEvent(event); + + assert.equal(component.error, true); + assert.equal(component.that, button); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-event-correct-this/main.svelte b/test/runtime/samples/error-handling-event-correct-this/main.svelte new file mode 100644 index 0000000000..89fe5e86a4 --- /dev/null +++ b/test/runtime/samples/error-handling-event-correct-this/main.svelte @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-event/_config.js b/test/runtime/samples/error-handling-event/_config.js new file mode 100644 index 0000000000..edd0bd074b --- /dev/null +++ b/test/runtime/samples/error-handling-event/_config.js @@ -0,0 +1,10 @@ +export default { + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); + + await button.dispatchEvent(event); + + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-event/main.svelte b/test/runtime/samples/error-handling-event/main.svelte new file mode 100644 index 0000000000..18f89a2b2c --- /dev/null +++ b/test/runtime/samples/error-handling-event/main.svelte @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-template-reactive/_config.js b/test/runtime/samples/error-handling-template-reactive/_config.js new file mode 100644 index 0000000000..edd0bd074b --- /dev/null +++ b/test/runtime/samples/error-handling-template-reactive/_config.js @@ -0,0 +1,10 @@ +export default { + async test({ assert, component, target, window }) { + const button = target.querySelector('button'); + const event = new window.MouseEvent('click'); + + await button.dispatchEvent(event); + + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-template-reactive/main.svelte b/test/runtime/samples/error-handling-template-reactive/main.svelte new file mode 100644 index 0000000000..425d59046a --- /dev/null +++ b/test/runtime/samples/error-handling-template-reactive/main.svelte @@ -0,0 +1,22 @@ + + +{a.b.c} + + \ No newline at end of file diff --git a/test/runtime/samples/error-handling-template/_config.js b/test/runtime/samples/error-handling-template/_config.js new file mode 100644 index 0000000000..acd4e2a2f0 --- /dev/null +++ b/test/runtime/samples/error-handling-template/_config.js @@ -0,0 +1,5 @@ +export default { + test({ assert, component }) { + assert.equal(component.error, true); + } +} \ No newline at end of file diff --git a/test/runtime/samples/error-handling-template/main.svelte b/test/runtime/samples/error-handling-template/main.svelte new file mode 100644 index 0000000000..461211a87d --- /dev/null +++ b/test/runtime/samples/error-handling-template/main.svelte @@ -0,0 +1,12 @@ + + +{a.b.c} \ No newline at end of file