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

chore(carto): Add test coverage for sources #8613

Merged
merged 2 commits into from Mar 11, 2024

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Mar 8, 2024

+10% coverage in @deck.gl/carto.

before after
before after

Related:

@donmccurdy
Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @donmccurdy and the rest of your teammates on Graphite Graphite

@coveralls
Copy link

coveralls commented Mar 8, 2024

Coverage Status

coverage: 82.609% (+1.0%) from 81.639%
when pulling 6642c64 on donmccurdy/chore-carto-sources-test-coverage
into 28fb60f on master.

@donmccurdy donmccurdy force-pushed the donmccurdy/chore-carto-sources-test-coverage branch 2 times, most recently from 0089c1d to 68d6018 Compare March 8, 2024 19:21
Copy link
Collaborator

@felixpalmer felixpalmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these 😊 !

}
};
async function setupMockFetchMapsV3(
cacheKey = btoa(Math.random().toFixed(4))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it necessary to add this cache key?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a module-level request cache ...

const REQUEST_CACHE = new Map();
export async function requestWithParameters<T = any>({
accessToken,
baseUrl,
parameters,
headers: customHeaders,
errorContext
}: {

... and I couldn't see a way to clear that cache between test runs. The way that fetch() calls are mocked now, tilejson requests are identical and would otherwise hit the cache.

@donmccurdy donmccurdy force-pushed the donmccurdy/chore-carto-sources-test-coverage branch from 68d6018 to 6642c64 Compare March 11, 2024 13:47
@donmccurdy donmccurdy merged commit 51a361a into master Mar 11, 2024
4 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/chore-carto-sources-test-coverage branch March 11, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants