diff --git a/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2-dev/_config.js b/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2-dev/_config.js index dc220e4f3d..f4e6bb8ffd 100644 --- a/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2-dev/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2-dev/_config.js @@ -16,8 +16,10 @@ export default test({ throw new Error('Expected an error'); } catch (err) { assert.equal( - /** @type {Error} */ (err).message, - 'svelte_component_invalid_this_value\nThe `this={...}` property of a `` must be a Svelte component, if defined' + /** @type {Error} */ (err).message.includes( + 'svelte_component_invalid_this_value\nThe `this={...}` property of a `` must be a Svelte component, if defined' + ), + true ); } } diff --git a/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2/_config.js b/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2/_config.js index f6eba49684..be7d341fff 100644 --- a/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/component-not-constructor2/_config.js @@ -12,7 +12,10 @@ export default test({ component.componentName = 'banana'; throw new Error('Expected an error'); } catch (err) { - assert.equal(/** @type {Error} */ (err).message, '$$component is not a function'); + assert.equal( + /** @type {Error} */ (err).message.includes('$$component is not a function'), + true + ); } } }); diff --git a/packages/svelte/tests/runtime-legacy/shared.ts b/packages/svelte/tests/runtime-legacy/shared.ts index 21012a8f5a..011b999c9f 100644 --- a/packages/svelte/tests/runtime-legacy/shared.ts +++ b/packages/svelte/tests/runtime-legacy/shared.ts @@ -392,9 +392,9 @@ async function run_test_variant( } } catch (err) { if (config.runtime_error) { - assert.equal((err as Error).message, config.runtime_error); + assert.equal((err as Error).message.includes(config.runtime_error), true); } else if (config.error && !unintended_error) { - assert.equal((err as Error).message, config.error); + assert.equal((err as Error).message.includes(config.error), true); } else { throw err; }