diff --git a/src/__tests__/context.test.js b/src/__tests__/context.test.js new file mode 100644 index 0000000..effdef4 --- /dev/null +++ b/src/__tests__/context.test.js @@ -0,0 +1,14 @@ +import { expect, test } from 'vitest' + +import { render } from '..' +import Comp from './fixtures/Context.svelte' + +test('can set a context', () => { + const message = 'Got it' + + const { getByText } = render(Comp, { + context: new Map(Object.entries({ foo: { message } })), + }) + + expect(getByText(message)).toBeTruthy() +}) diff --git a/src/__tests__/fixtures/Context.svelte b/src/__tests__/fixtures/Context.svelte new file mode 100644 index 0000000..be8253b --- /dev/null +++ b/src/__tests__/fixtures/Context.svelte @@ -0,0 +1,7 @@ + + +