Skip to content

Commit 0c1a4bb

Browse files
committed
fixup: jest compat again
1 parent 7788328 commit 0c1a4bb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/core/props.svelte.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const createProps = (initialProps) => {
2929
})
3030

3131
const update = (nextProps) => {
32-
currentProps = { ...Object.assign(targetProps, nextProps) }
32+
currentProps = { ...currentProps, ...nextProps }
3333
}
3434

3535
return [props, update]

tests/rerender.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { act, render, screen } from '@testing-library/svelte'
22
import { beforeAll, describe, expect, test, vi } from 'vitest'
33

4-
import { COMPONENT_FIXTURES, IS_SVELTE_5, MODE_RUNES } from './_env.js'
4+
import { COMPONENT_FIXTURES, IS_JEST, IS_SVELTE_5, MODE_RUNES } from './_env.js'
55

66
describe.each(COMPONENT_FIXTURES)('rerender ($mode)', ({ mode, component }) => {
77
let Comp
@@ -53,7 +53,9 @@ describe.each(COMPONENT_FIXTURES)('rerender ($mode)', ({ mode, component }) => {
5353
})
5454
})
5555

56-
describe.runIf(IS_SVELTE_5)('reactive prop handling', () => {
56+
// NOTE: Jest does not support `structuredClone`, used in this test
57+
// to check that `input` isn't turned into a Proxy
58+
describe.runIf(IS_SVELTE_5 && !IS_JEST)('reactive prop handling', () => {
5759
let Comp
5860

5961
beforeAll(async () => {

0 commit comments

Comments
 (0)