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

Fix tests and prevent errors when removing the map #527

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josh-cloudscape
Copy link
Contributor

chore(deps): revert @deck.gl/layers to 8.8.9

This fixes the tests that were failing. It looks like @deck.gl uses dependencies that were converted to esm modules and jest isn't currently set up to handle them.

Jest encountered an unexpected token
...
/home/runner/work/react-map-gl/react-map-gl/node_modules/@deck.gl/layers/node_modules/@mapbox/tiny-sdf/index.js:3
export default class TinySDF {
^^^^^^

SyntaxError: Unexpected token 'export'

Reference: visgl/deck.gl#7735


fix(image): don't add images if map or component is unloaded

Prevents errors when unmounting the map while images are still loading.

This fixes the tests that were failing. It looks like @deck.gl uses
dependencies that were converted to esm modules and jest isn't currently
set up to handle them.

```
Jest encountered an unexpected token
...
/home/runner/work/react-map-gl/react-map-gl/node_modules/@deck.gl/layers/node_modules/@mapbox/tiny-sdf/index.js:3
export default class TinySDF {
^^^^^^

SyntaxError: Unexpected token 'export'
```

Reference: visgl/deck.gl#7735
Prevents errors when unmounting the map while images are still loading.
@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 85.71% and project coverage change: -0.25 ⚠️

Comparison is base (f58539a) 97.96% compared to head (584e8e0) 97.72%.

❗ Current head 584e8e0 differs from pull request most recent head 36cb600. Consider uploading reports for the commit 36cb600 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   97.96%   97.72%   -0.25%     
==========================================
  Files          28       28              
  Lines         738      746       +8     
  Branches      189      191       +2     
==========================================
+ Hits          723      729       +6     
- Misses         11       13       +2     
  Partials        4        4              
Impacted Files Coverage Δ
src/components/Image/index.js 95.55% <85.71%> (-4.45%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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

Successfully merging this pull request may close these issues.

1 participant