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

tests: mock API calls in +page.ts file #311

Open
MRita443 opened this issue Jan 26, 2025 · 0 comments
Open

tests: mock API calls in +page.ts file #311

MRita443 opened this issue Jan 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@MRita443
Copy link
Collaborator

Our current integration with MSW seems to function only when the API calls are done within the <script> tag of the +page.svelte file. From our experiments, which included attempting to mock the +page.js module, researching specific support from the msw-storybook-addon package, and switching the loading code to +page.svelte, we could not get this to work with the loading code in +page.ts. The problem with having the code in the svelte page is that errors thrown are not presented with the +error.svelte page.

@MRita443 MRita443 added the bug Something isn't working label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant