Skip to content

Commit 914a5bb

Browse files
committed
context.test.js fails too
1 parent 6f494ad commit 914a5bb

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/__tests__/context.test.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import { expect, test } from 'vitest'
2+
import { VERSION as SVELTE_VERSION } from 'svelte/compiler'
23

34
import { render } from '..'
45
import Comp from './fixtures/Context.svelte'
56

6-
test('can set a context', () => {
7-
const message = 'Got it'
7+
test.skipIf(SVELTE_VERSION >= '5' && process.env.VITEST_ENV == 'happy-dom')(
8+
'can set a context',
9+
() => {
10+
const message = 'Got it'
811

9-
const { getByText } = render(Comp, {
10-
context: new Map(Object.entries({ foo: { message } })),
11-
})
12+
const { getByText } = render(Comp, {
13+
context: new Map(Object.entries({ foo: { message } })),
14+
})
1215

13-
expect(getByText(message)).toBeTruthy()
14-
})
16+
expect(getByText(message)).toBeTruthy()
17+
}
18+
)

0 commit comments

Comments
 (0)