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(svelte-query): Reorganise for multiple components per test #7654

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

lachlancollins
Copy link
Member

@lachlancollins lachlancollins commented Jul 1, 2024

Compared to the react-query tests, it's not quite as straightforward to write svelte-query tests, as they can't be included as functions within the test definition, but need to be separate file components.

This PR refactors each source file's tests to be a folder, making it easier to add multiple components per test (rather than trying to conform a single component to poorly suit multiple tests).

As a demo, I've added new tests for useIsFetching and QueryClientProvider, and an additional test for createQuery

I'm hoping this structure will make it easier to add more tests going forward!

Coverage is up from 69.42% to 80.99%

Copy link

vercel bot commented Jul 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Jul 1, 2024 0:05am

Copy link

nx-cloud bot commented Jul 1, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 6d6a378. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@lachlancollins lachlancollins changed the title Move tests tests(svelte-query): Reorganise for multiple components per test Jul 1, 2024
Copy link

codesandbox-ci bot commented Jul 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6d6a378:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.86%. Comparing base (56fad10) to head (6d6a378).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #7654       +/-   ##
===========================================
+ Coverage   44.08%   80.86%   +36.77%     
===========================================
  Files         185       18      -167     
  Lines        7054      162     -6892     
  Branches     1553       32     -1521     
===========================================
- Hits         3110      131     -2979     
+ Misses       3578       27     -3551     
+ Partials      366        4      -362     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental ∅ <ø> (∅)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister ∅ <ø> (∅)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core ∅ <ø> (∅)
@tanstack/query-devtools ∅ <ø> (∅)
@tanstack/query-persist-client-core ∅ <ø> (∅)
@tanstack/query-sync-storage-persister ∅ <ø> (∅)
@tanstack/react-query ∅ <ø> (∅)
@tanstack/react-query-devtools ∅ <ø> (∅)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client ∅ <ø> (∅)
@tanstack/solid-query ∅ <ø> (∅)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client ∅ <ø> (∅)
@tanstack/svelte-query 79.33% <ø> (+10.66%) ⬆️
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client 100.00% <ø> (ø)
@tanstack/vue-query ∅ <ø> (∅)
@tanstack/vue-query-devtools ∅ <ø> (∅)

@lachlancollins lachlancollins merged commit f1cdea9 into main Jul 1, 2024
8 checks passed
@lachlancollins lachlancollins deleted the svelte-tests branch July 1, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant