Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section on Testing the ContextAPI is unintelligible (to a newb) #617

Open
pboling opened this issue May 17, 2024 · 0 comments
Open

Section on Testing the ContextAPI is unintelligible (to a newb) #617

pboling opened this issue May 17, 2024 · 0 comments

Comments

@pboling
Copy link

pboling commented May 17, 2024

Points of confusion:

  1. There are so many referenced files that are not in evidence.
  2. Directly after the preface says that we would create a test component to test the context, there are references to a Parent component and OriginalParentComponent that exit somewhere else?
  3. The examples are not provided with file names, but then are referenced in the final test source as if we knew what the filenames were somehow.
  4. One file has setContext, while the other has getContext, but only one of them is referenced as ContextTest... ?
  5. setContext is imported from svelte, but getContext is not?

Feeling very lost.

This is my first attempt at writing a test in svelte, and I'm clearly in way over my head, but I think users like me are a target for this documentation, so I hope sharing my confusion can help improve the docs!

ref: https://www.sveltesociety.dev/recipes/testing-and-debugging/unit-testing-svelte-component (bottom of page, final section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant