From bb93e075b9e6903956140d59e7dd307a9bd56d1d Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Fri, 20 Sep 2024 16:00:09 +0200 Subject: [PATCH 1/5] use vitest globals --- jest.config.ts | 67 ------------------- src/data/bucket/fill_bucket.test.ts | 2 - src/data/bucket/line_bucket.test.ts | 1 - src/data/bucket/symbol_bucket.test.ts | 1 - src/data/dem_data.test.ts | 1 - src/data/feature_position_map.test.ts | 1 - src/data/load_geometry.test.ts | 1 - src/geo/edge_insets.test.ts | 1 - src/geo/lng_lat.test.ts | 1 - src/geo/lng_lat_bounds.test.ts | 1 - src/geo/mercator_coordinate.test.ts | 1 - src/geo/transform.test.ts | 1 - src/gl/render_pool.test.ts | 1 - src/gl/state.test.ts | 1 - src/gl/vertex_buffer.test.ts | 1 - src/index.test.ts | 1 - src/render/draw_custom.test.ts | 2 +- src/render/draw_debug.test.ts | 1 - src/render/draw_fill.test.ts | 2 +- src/render/draw_symbol.test.ts | 2 +- src/render/glyph_manager.test.ts | 1 - src/render/line_atlas.test.ts | 1 - src/render/painter.test.ts | 1 - src/render/render_to_texture.test.ts | 1 - src/render/terrain.test.ts | 1 - src/render/uniform_binding.test.ts | 1 - ...pdate_pattern_positions_in_program.test.ts | 1 - src/shaders/encode_attribute.test.ts | 1 - src/source/canvas_source.test.ts | 1 - src/source/geojson_source.test.ts | 1 - src/source/geojson_source_diff.test.ts | 1 - src/source/geojson_worker_source.test.ts | 1 - src/source/geojson_wrapper.test.ts | 1 - src/source/image_source.test.ts | 1 - src/source/query_features.test.ts | 1 - src/source/raster_dem_tile_source.test.ts | 1 - .../raster_dem_tile_worker_source.test.ts | 1 - src/source/raster_tile_source.test.ts | 1 - .../rtl_text_plugin_main_thread.test.ts | 1 - src/source/source.test.ts | 1 - src/source/source_cache.test.ts | 1 - src/source/terrain_source_cache.test.ts | 1 - src/source/tile.test.ts | 1 - src/source/tile_cache.test.ts | 1 - src/source/tile_id.test.ts | 1 - src/source/vector_tile_source.test.ts | 1 - src/source/vector_tile_worker_source.test.ts | 1 - src/source/video_source.test.ts | 1 - src/source/worker.test.ts | 1 - src/source/worker_tile.test.ts | 1 - src/style/format_section_override.test.ts | 1 - src/style/light.test.ts | 1 - src/style/load_glyph_range.test.ts | 1 - src/style/load_sprite.test.ts | 1 - src/style/query_utils.test.ts | 1 - src/style/style.test.ts | 1 - src/style/style_layer.test.ts | 1 - .../style_layer/fill_style_layer.test.ts | 1 - .../style_layer/line_style_layer.test.ts | 1 - src/style/style_layer/overlap_mode.test.ts | 1 - .../style_layer/variable_text_anchor.test.ts | 1 - src/style/style_layer_index.test.ts | 1 - src/symbol/anchor.test.ts | 1 - src/symbol/check_max_angle.test.ts | 1 - src/symbol/clip_line.test.ts | 1 - src/symbol/collision_feature.test.ts | 1 - src/symbol/collision_index.test.ts | 1 - src/symbol/cross_tile_symbol_index.test.ts | 1 - src/symbol/get_anchors.test.ts | 1 - src/symbol/grid_index.test.ts | 1 - src/symbol/merge_lines.test.ts | 1 - src/symbol/path_interpolator.test.ts | 1 - src/symbol/projection.test.ts | 1 - src/symbol/quads.test.ts | 1 - src/symbol/shaping.test.ts | 1 - src/symbol/symbol_style_layer.test.ts | 1 - src/ui/camera.test.ts | 1 - src/ui/control/attribution_control.test.ts | 1 - src/ui/control/fullscreen_control.test.ts | 1 - src/ui/control/geolocate_control.test.ts | 1 - src/ui/control/logo_control.test.ts | 1 - src/ui/control/navigation_control.test.ts | 1 - src/ui/control/scale_control.test.ts | 1 - src/ui/control/terrain_control.test.ts | 1 - src/ui/handler/box_zoom.test.ts | 1 - src/ui/handler/cooperative_gestures.test.ts | 1 - src/ui/handler/dblclick_zoom.test.ts | 1 - src/ui/handler/drag_pan.test.ts | 1 - src/ui/handler/drag_rotate.test.ts | 1 - src/ui/handler/keyboard.test.ts | 1 - src/ui/handler/map_event.test.ts | 1 - .../handler/mouse_handler_interface.test.ts | 1 - src/ui/handler/mouse_rotate.test.ts | 1 - ...inger_touch_drag_handler_interface.test.ts | 1 - src/ui/handler/scroll_zoom.test.ts | 1 - src/ui/handler/tap_drag_zoom.test.ts | 2 - src/ui/handler/two_fingers_touch.test.ts | 1 - src/ui/hash.test.ts | 1 - src/ui/map_tests/map_animation.test.ts | 1 - src/ui/map_tests/map_basic.test.ts | 1 - src/ui/map_tests/map_bounds.test.ts | 1 - .../map_calculate_camera_options.test.ts | 1 - src/ui/map_tests/map_canvas.test.ts | 1 - src/ui/map_tests/map_control.test.ts | 1 - src/ui/map_tests/map_disable_handlers.test.ts | 1 - src/ui/map_tests/map_events.test.ts | 1 - src/ui/map_tests/map_feature_state.test.ts | 1 - src/ui/map_tests/map_images.test.ts | 1 - src/ui/map_tests/map_is_moving.test.ts | 1 - src/ui/map_tests/map_is_rotating.test.ts | 1 - src/ui/map_tests/map_is_zooming.test.ts | 1 - src/ui/map_tests/map_layer.test.ts | 1 - src/ui/map_tests/map_options.test.ts | 1 - src/ui/map_tests/map_pitch.test.ts | 1 - src/ui/map_tests/map_pixel_ratio.test.ts | 1 - .../map_query_rendered_features.test.ts | 1 - src/ui/map_tests/map_render.test.ts | 1 - .../map_request_render_frame.test.ts | 1 - src/ui/map_tests/map_resize.test.ts | 1 - src/ui/map_tests/map_style.test.ts | 1 - src/ui/map_tests/map_terrian.test.ts | 1 - src/ui/map_tests/map_webgl.test.ts | 1 - src/ui/map_tests/map_world_copies.test.ts | 1 - src/ui/map_tests/map_zoom.test.ts | 1 - src/ui/marker.test.ts | 1 - src/ui/popup.test.ts | 1 - src/util/actor.test.ts | 1 - src/util/ajax.test.ts | 1 - src/util/browser.test.ts | 1 - src/util/color_ramp.test.ts | 2 - src/util/dispatcher.test.ts | 1 - src/util/evented.test.ts | 1 - src/util/find_pole_of_inaccessibility.test.ts | 1 - src/util/geolocation_support.test.ts | 1 - src/util/image_request.test.ts | 1 - src/util/is_char_in_unicode_block.test.ts | 1 - src/util/offscreen_canvas_distorted.test.ts | 1 - src/util/primitives.test.ts | 1 - src/util/resolve_tokens.test.ts | 1 - src/util/script_detection.test.ts | 1 - src/util/smart_wrap.test.ts | 1 - src/util/struct_array.test.ts | 1 - src/util/style.test.ts | 1 - src/util/task_queue.test.ts | 1 - src/util/test/util.ts | 1 - src/util/throttle.test.ts | 1 - src/util/transferable_grid_index.test.ts | 1 - src/util/util.test.ts | 1 - src/util/web_worker_transfer.test.ts | 1 - src/util/worker_pool.test.ts | 1 - src/util/world_bounds.test.ts | 1 - test/build/dev.test.ts | 1 - test/build/import.test.ts | 1 - test/build/min.test.ts | 1 - .../symbol-shaping/shaping.test.ts | 1 - tsconfig.jest.json | 6 -- tsconfig.json | 6 +- vitest.config.unit.ts | 1 + 158 files changed, 8 insertions(+), 232 deletions(-) delete mode 100644 jest.config.ts delete mode 100644 tsconfig.jest.json diff --git a/jest.config.ts b/jest.config.ts deleted file mode 100644 index 58baa44515d..00000000000 --- a/jest.config.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type {Config} from 'jest'; - -const sharedConfig = { - transform: { - // use typescript to convert from esm to cjs - '[.](m|c)?(ts|js)(x)?$': ['ts-jest', { - 'isolatedModules': true, - 'tsconfig': 'tsconfig.jest.json' - }], - }, - // any tests that operate on dist files shouldn't compile them again. - transformIgnorePatterns: ['/dist'], - modulePathIgnorePatterns: ['/dist'] -} as Partial; - -const config: Config = { - coverageProvider: 'v8', - reporters: [ - 'github-actions', - 'jest-junit', - ['jest-monocart-coverage', { - name: 'MapLibre Unit Coverage Report', - - reports: [ - ['codecov'] - ], - - sourceFilter: (sourcePath) => { - return !sourcePath.includes('node_modules/') && sourcePath.search(/src\//) !== -1; - }, - - outputDir: './coverage/jest' - }] - ], - projects: [ - { - displayName: 'unit', - testEnvironment: 'jsdom', - setupFiles: [ - 'jest-webgl-canvas-mock', - './test/unit/lib/web_worker_mock.ts' - ], - testMatch: [ - '/src/**/*.test.{ts,js}' - ], - ...sharedConfig - }, - { - displayName: 'integration', - testEnvironment: 'node', - testMatch: [ - '/test/integration/**/*.test.{ts,js}', - ], - ...sharedConfig, - }, - { - displayName: 'build', - testEnvironment: 'node', - testMatch: [ - '/test/build/**/*.test.{ts,js}', - ], - ...sharedConfig, - }, - ] -}; - -export default config; diff --git a/src/data/bucket/fill_bucket.test.ts b/src/data/bucket/fill_bucket.test.ts index ca791af5588..0a7628b8a03 100644 --- a/src/data/bucket/fill_bucket.test.ts +++ b/src/data/bucket/fill_bucket.test.ts @@ -1,5 +1,3 @@ -import {test, expect} from 'vitest'; - import fs from 'fs'; import path from 'path'; import Protobuf from 'pbf'; diff --git a/src/data/bucket/line_bucket.test.ts b/src/data/bucket/line_bucket.test.ts index 1d14b165530..45bbf7c985c 100644 --- a/src/data/bucket/line_bucket.test.ts +++ b/src/data/bucket/line_bucket.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import fs from 'fs'; import path from 'path'; import Protobuf from 'pbf'; diff --git a/src/data/bucket/symbol_bucket.test.ts b/src/data/bucket/symbol_bucket.test.ts index 96c39df307e..d4367176ec5 100644 --- a/src/data/bucket/symbol_bucket.test.ts +++ b/src/data/bucket/symbol_bucket.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import fs from 'fs'; import path from 'path'; import Protobuf from 'pbf'; diff --git a/src/data/dem_data.test.ts b/src/data/dem_data.test.ts index ee579ab4a3d..a5d1994f98a 100644 --- a/src/data/dem_data.test.ts +++ b/src/data/dem_data.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {DEMData} from './dem_data'; import {RGBAImage} from '../util/image'; import {serialize, deserialize} from '../util/web_worker_transfer'; diff --git a/src/data/feature_position_map.test.ts b/src/data/feature_position_map.test.ts index ae97996cc4d..31a1cff7d46 100644 --- a/src/data/feature_position_map.test.ts +++ b/src/data/feature_position_map.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {FeaturePositionMap} from './feature_position_map'; import {serialize, deserialize} from '../util/web_worker_transfer'; diff --git a/src/data/load_geometry.test.ts b/src/data/load_geometry.test.ts index b22d01aaf1f..40d44d6e61c 100644 --- a/src/data/load_geometry.test.ts +++ b/src/data/load_geometry.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import fs from 'fs'; import path from 'path'; import Protobuf from 'pbf'; diff --git a/src/geo/edge_insets.test.ts b/src/geo/edge_insets.test.ts index 15e0899f86e..ad2eff55b10 100644 --- a/src/geo/edge_insets.test.ts +++ b/src/geo/edge_insets.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {EdgeInsets} from '../geo/edge_insets'; describe('EdgeInsets', () => { diff --git a/src/geo/lng_lat.test.ts b/src/geo/lng_lat.test.ts index 110cdec66e6..2833a7f10b0 100644 --- a/src/geo/lng_lat.test.ts +++ b/src/geo/lng_lat.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {LngLat} from '../geo/lng_lat'; describe('LngLat', () => { diff --git a/src/geo/lng_lat_bounds.test.ts b/src/geo/lng_lat_bounds.test.ts index c14154f2d1f..85f812dd95e 100644 --- a/src/geo/lng_lat_bounds.test.ts +++ b/src/geo/lng_lat_bounds.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {LngLat} from './lng_lat'; import {LngLatBounds} from './lng_lat_bounds'; diff --git a/src/geo/mercator_coordinate.test.ts b/src/geo/mercator_coordinate.test.ts index 99269249842..305bb49235f 100644 --- a/src/geo/mercator_coordinate.test.ts +++ b/src/geo/mercator_coordinate.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {LngLat} from './lng_lat'; import {MercatorCoordinate, mercatorScale} from './mercator_coordinate'; diff --git a/src/geo/transform.test.ts b/src/geo/transform.test.ts index 0a4e7253cb0..402e391f2d6 100644 --- a/src/geo/transform.test.ts +++ b/src/geo/transform.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {MAX_VALID_LATITUDE, Transform} from './transform'; import {LngLat} from './lng_lat'; diff --git a/src/gl/render_pool.test.ts b/src/gl/render_pool.test.ts index 0c1c4ea64b5..520b3b28d8f 100644 --- a/src/gl/render_pool.test.ts +++ b/src/gl/render_pool.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Context} from './context'; import {RenderPool} from './render_pool'; diff --git a/src/gl/state.test.ts b/src/gl/state.test.ts index 465eef3d837..82037f50fcf 100644 --- a/src/gl/state.test.ts +++ b/src/gl/state.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {IValue, ClearColor, ClearDepth, ClearStencil, ColorMask, DepthMask, StencilMask, StencilFunc, StencilOp, StencilTest, DepthRange, DepthTest, DepthFunc, Blend, BlendFunc, BlendColor, ProgramValue, ActiveTextureUnit, Viewport, BindFramebuffer, BindRenderbuffer, BindTexture, BindVertexBuffer, BindElementBuffer, BindVertexArray, PixelStoreUnpack, PixelStoreUnpackPremultiplyAlpha} from './value'; import {Context} from './context'; import {Color} from '@maplibre/maplibre-gl-style-spec'; diff --git a/src/gl/vertex_buffer.test.ts b/src/gl/vertex_buffer.test.ts index a3756327828..2a0d263d0dc 100644 --- a/src/gl/vertex_buffer.test.ts +++ b/src/gl/vertex_buffer.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {VertexBuffer} from './vertex_buffer'; import {StructArrayLayout3i6} from '../data/array_types.g'; import {Context} from '../gl/context'; diff --git a/src/index.test.ts b/src/index.test.ts index ea2ebd4f24f..121614b75da 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterAll, test, expect} from 'vitest'; import {config} from './util/config'; import {addProtocol, getWorkerCount, removeProtocol, getVersion} from './index'; import {getJSON, getArrayBuffer} from './util/ajax'; diff --git a/src/render/draw_custom.test.ts b/src/render/draw_custom.test.ts index ccfaa1f3998..22274694b5b 100644 --- a/src/render/draw_custom.test.ts +++ b/src/render/draw_custom.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi, Mock} from 'vitest'; import {mat4} from 'gl-matrix'; import {OverscaledTileID} from '../source/tile_id'; import {SourceCache} from '../source/source_cache'; @@ -8,6 +7,7 @@ import type {Map} from '../ui/map'; import {Transform} from '../geo/transform'; import {drawCustom} from './draw_custom'; import {CustomStyleLayer} from '../style/style_layer/custom_style_layer'; +import {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); diff --git a/src/render/draw_debug.test.ts b/src/render/draw_debug.test.ts index 295af3c1070..607f727ecc9 100644 --- a/src/render/draw_debug.test.ts +++ b/src/render/draw_debug.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {SourceCache} from '../source/source_cache'; import {RasterSourceSpecification, SourceSpecification, VectorSourceSpecification} from '@maplibre/maplibre-gl-style-spec'; import {Style} from '../style/style'; diff --git a/src/render/draw_fill.test.ts b/src/render/draw_fill.test.ts index 653aa6d3f66..9300f2b9d5c 100644 --- a/src/render/draw_fill.test.ts +++ b/src/render/draw_fill.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi, Mock} from 'vitest'; import {mat4} from 'gl-matrix'; import {OverscaledTileID} from '../source/tile_id'; import {SourceCache} from '../source/source_cache'; @@ -15,6 +14,7 @@ import {FillStyleLayer} from '../style/style_layer/fill_style_layer'; import {drawFill} from './draw_fill'; import {FillBucket} from '../data/bucket/fill_bucket'; import {ProgramConfiguration, ProgramConfigurationSet} from '../data/program_configuration'; +import {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); diff --git a/src/render/draw_symbol.test.ts b/src/render/draw_symbol.test.ts index 26a02f1c861..12d4aee0168 100644 --- a/src/render/draw_symbol.test.ts +++ b/src/render/draw_symbol.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi, Mock} from 'vitest'; import {mat4} from 'gl-matrix'; import {OverscaledTileID} from '../source/tile_id'; import {SymbolBucket} from '../data/bucket/symbol_bucket'; @@ -15,6 +14,7 @@ import {Transform} from '../geo/transform'; import type {EvaluationParameters} from '../style/evaluation_parameters'; import type {SymbolLayerSpecification} from '@maplibre/maplibre-gl-style-spec'; import {Style} from '../style/style'; +import {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); diff --git a/src/render/glyph_manager.test.ts b/src/render/glyph_manager.test.ts index e469e5974a6..67daad289f7 100644 --- a/src/render/glyph_manager.test.ts +++ b/src/render/glyph_manager.test.ts @@ -1,4 +1,3 @@ -import {describe, afterEach, test, expect, vi} from 'vitest'; import {parseGlyphPbf} from '../style/parse_glyph_pbf'; import {GlyphManager} from './glyph_manager'; import fs from 'fs'; diff --git a/src/render/line_atlas.test.ts b/src/render/line_atlas.test.ts index 7c740d2cbcc..a672500c05c 100644 --- a/src/render/line_atlas.test.ts +++ b/src/render/line_atlas.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {LineAtlas} from './line_atlas'; describe('LineAtlas', () => { diff --git a/src/render/painter.test.ts b/src/render/painter.test.ts index f86674c60ee..d5992a2fc68 100644 --- a/src/render/painter.test.ts +++ b/src/render/painter.test.ts @@ -1,4 +1,3 @@ -import {test} from 'vitest'; import {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec'; import {Painter} from './painter'; diff --git a/src/render/render_to_texture.test.ts b/src/render/render_to_texture.test.ts index f29b48bc8be..d567c7753f6 100644 --- a/src/render/render_to_texture.test.ts +++ b/src/render/render_to_texture.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {RenderToTexture} from './render_to_texture'; import type {Painter} from './painter'; import type {LineStyleLayer} from '../style/style_layer/line_style_layer'; diff --git a/src/render/terrain.test.ts b/src/render/terrain.test.ts index 364a996fd37..8dcb29298d1 100644 --- a/src/render/terrain.test.ts +++ b/src/render/terrain.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import Point from '@mapbox/point-geometry'; import {Terrain} from './terrain'; import {Context} from '../gl/context'; diff --git a/src/render/uniform_binding.test.ts b/src/render/uniform_binding.test.ts index 164a479fd86..a80a15e3fee 100644 --- a/src/render/uniform_binding.test.ts +++ b/src/render/uniform_binding.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {mat4} from 'gl-matrix'; import {Context} from '../gl/context'; import { diff --git a/src/render/update_pattern_positions_in_program.test.ts b/src/render/update_pattern_positions_in_program.test.ts index 84a20626a2d..6073d7984ae 100644 --- a/src/render/update_pattern_positions_in_program.test.ts +++ b/src/render/update_pattern_positions_in_program.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Tile} from '../source/tile'; import {OverscaledTileID} from '../source/tile_id'; import {updatePatternPositionsInProgram} from './update_pattern_positions_in_program'; diff --git a/src/shaders/encode_attribute.test.ts b/src/shaders/encode_attribute.test.ts index 6be98881d8f..e9c37949828 100644 --- a/src/shaders/encode_attribute.test.ts +++ b/src/shaders/encode_attribute.test.ts @@ -1,4 +1,3 @@ -import {test, expect} from 'vitest'; import {packUint8ToFloat} from './encode_attribute'; test('packUint8ToFloat', () => { diff --git a/src/source/canvas_source.test.ts b/src/source/canvas_source.test.ts index 0ce9af11ac1..0fd80a50b5d 100644 --- a/src/source/canvas_source.test.ts +++ b/src/source/canvas_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {CanvasSource} from '../source/canvas_source'; import {Transform} from '../geo/transform'; import {Event, Evented} from '../util/evented'; diff --git a/src/source/geojson_source.test.ts b/src/source/geojson_source.test.ts index 54539f40cb2..030b3a301c3 100644 --- a/src/source/geojson_source.test.ts +++ b/src/source/geojson_source.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Tile} from './tile'; import {OverscaledTileID} from './tile_id'; import {GeoJSONSource, GeoJSONSourceOptions} from './geojson_source'; diff --git a/src/source/geojson_source_diff.test.ts b/src/source/geojson_source_diff.test.ts index faa03e2a6b3..6625b692223 100644 --- a/src/source/geojson_source_diff.test.ts +++ b/src/source/geojson_source_diff.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {setPerformance} from '../util/test/util'; import {type GeoJSONFeatureId, isUpdateableGeoJSON, toUpdateable, applySourceDiff} from './geojson_source_diff'; diff --git a/src/source/geojson_worker_source.test.ts b/src/source/geojson_worker_source.test.ts index 96b92715bf8..bebccbeba71 100644 --- a/src/source/geojson_worker_source.test.ts +++ b/src/source/geojson_worker_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {GeoJSONWorkerSource, LoadGeoJSONParameters} from './geojson_worker_source'; import {StyleLayerIndex} from '../style/style_layer_index'; import {OverscaledTileID} from './tile_id'; diff --git a/src/source/geojson_wrapper.test.ts b/src/source/geojson_wrapper.test.ts index 904dce4949b..b0f37a28a35 100644 --- a/src/source/geojson_wrapper.test.ts +++ b/src/source/geojson_wrapper.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {GeoJSONWrapper} from './geojson_wrapper'; describe('geojsonwrapper', () => { diff --git a/src/source/image_source.test.ts b/src/source/image_source.test.ts index 728de74b8eb..0540098de6f 100644 --- a/src/source/image_source.test.ts +++ b/src/source/image_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {ImageSource} from './image_source'; import {Evented} from '../util/evented'; import {Transform} from '../geo/transform'; diff --git a/src/source/query_features.test.ts b/src/source/query_features.test.ts index 35b5aed5bac..29fa78e44f2 100644 --- a/src/source/query_features.test.ts +++ b/src/source/query_features.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import { queryRenderedFeatures, querySourceFeatures diff --git a/src/source/raster_dem_tile_source.test.ts b/src/source/raster_dem_tile_source.test.ts index b5ba1ee316b..8d14270f495 100644 --- a/src/source/raster_dem_tile_source.test.ts +++ b/src/source/raster_dem_tile_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi, it} from 'vitest'; import {fakeServer, FakeServer} from 'nise'; import {RasterDEMTileSource} from './raster_dem_tile_source'; import {OverscaledTileID} from './tile_id'; diff --git a/src/source/raster_dem_tile_worker_source.test.ts b/src/source/raster_dem_tile_worker_source.test.ts index a63c6df1ea4..f76e2e68a5a 100644 --- a/src/source/raster_dem_tile_worker_source.test.ts +++ b/src/source/raster_dem_tile_worker_source.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {RasterDEMTileWorkerSource} from './raster_dem_tile_worker_source'; import {DEMData} from '../data/dem_data'; import {WorkerDEMTileParameters} from './worker_source'; diff --git a/src/source/raster_tile_source.test.ts b/src/source/raster_tile_source.test.ts index 2673cf2b6e3..7b01d1c282b 100644 --- a/src/source/raster_tile_source.test.ts +++ b/src/source/raster_tile_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi, it} from 'vitest'; import {RasterTileSource} from './raster_tile_source'; import {OverscaledTileID} from './tile_id'; import {RequestManager} from '../util/request_manager'; diff --git a/src/source/rtl_text_plugin_main_thread.test.ts b/src/source/rtl_text_plugin_main_thread.test.ts index 787752731db..5becd707c4d 100644 --- a/src/source/rtl_text_plugin_main_thread.test.ts +++ b/src/source/rtl_text_plugin_main_thread.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, it, afterEach, expect, vi} from 'vitest'; import {FakeServer, fakeServer} from 'nise'; import {rtlMainThreadPluginFactory} from './rtl_text_plugin_main_thread'; import {sleep} from '../util/test/util'; diff --git a/src/source/source.test.ts b/src/source/source.test.ts index 3163fdf0ffa..e58d22108cd 100644 --- a/src/source/source.test.ts +++ b/src/source/source.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Dispatcher} from '../util/dispatcher'; import {SourceClass, addSourceType, create} from './source'; diff --git a/src/source/source_cache.test.ts b/src/source/source_cache.test.ts index f51d5221038..6b52ec088f9 100644 --- a/src/source/source_cache.test.ts +++ b/src/source/source_cache.test.ts @@ -1,4 +1,3 @@ -import {describe, afterEach, test, expect, vi} from 'vitest'; import {SourceCache} from './source_cache'; import {Map} from '../ui/map'; import {Source, addSourceType} from './source'; diff --git a/src/source/terrain_source_cache.test.ts b/src/source/terrain_source_cache.test.ts index ac4fcc628c5..3e0b433e4d2 100644 --- a/src/source/terrain_source_cache.test.ts +++ b/src/source/terrain_source_cache.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeAll, afterAll, test, expect} from 'vitest'; import {TerrainSourceCache} from './terrain_source_cache'; import {Style} from '../style/style'; import {RequestManager} from '../util/request_manager'; diff --git a/src/source/tile.test.ts b/src/source/tile.test.ts index b955ca575f2..1e3a05d8a34 100644 --- a/src/source/tile.test.ts +++ b/src/source/tile.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {createSymbolBucket} from '../../test/unit/lib/create_symbol_layer'; import {Tile} from '../source/tile'; import {GeoJSONWrapper, Feature} from '../source/geojson_wrapper'; diff --git a/src/source/tile_cache.test.ts b/src/source/tile_cache.test.ts index ab11f14fd9d..4a6173653bd 100644 --- a/src/source/tile_cache.test.ts +++ b/src/source/tile_cache.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {Tile} from './tile'; import {TileCache} from './tile_cache'; import {OverscaledTileID} from './tile_id'; diff --git a/src/source/tile_id.test.ts b/src/source/tile_id.test.ts index a42a685aef8..56c71479037 100644 --- a/src/source/tile_id.test.ts +++ b/src/source/tile_id.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {CanonicalTileID, OverscaledTileID} from '../source/tile_id'; import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from '../util/util'; diff --git a/src/source/vector_tile_source.test.ts b/src/source/vector_tile_source.test.ts index 40c01edb813..5c7f56a025c 100644 --- a/src/source/vector_tile_source.test.ts +++ b/src/source/vector_tile_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {fakeServer, type FakeServer} from 'nise'; import {Source} from './source'; import {VectorTileSource} from './vector_tile_source'; diff --git a/src/source/vector_tile_worker_source.test.ts b/src/source/vector_tile_worker_source.test.ts index 53b9e8ecb93..af4983dda9e 100644 --- a/src/source/vector_tile_worker_source.test.ts +++ b/src/source/vector_tile_worker_source.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import fs from 'fs'; import path from 'path'; import vt from '@mapbox/vector-tile'; diff --git a/src/source/video_source.test.ts b/src/source/video_source.test.ts index 58c788be28d..69d6d3b78c9 100644 --- a/src/source/video_source.test.ts +++ b/src/source/video_source.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {VideoSource} from './video_source'; import {extend} from '../util/util'; import {getMockDispatcher} from '../util/test/util'; diff --git a/src/source/worker.test.ts b/src/source/worker.test.ts index 447baa3eeb8..555ce6d2193 100644 --- a/src/source/worker.test.ts +++ b/src/source/worker.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {fakeServer} from 'nise'; import Worker from './worker'; import {LayerSpecification} from '@maplibre/maplibre-gl-style-spec'; diff --git a/src/source/worker_tile.test.ts b/src/source/worker_tile.test.ts index 965ac4cc576..f00604d98ab 100644 --- a/src/source/worker_tile.test.ts +++ b/src/source/worker_tile.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {WorkerTile} from '../source/worker_tile'; import {GeoJSONWrapper, Feature} from '../source/geojson_wrapper'; import {OverscaledTileID} from '../source/tile_id'; diff --git a/src/style/format_section_override.test.ts b/src/style/format_section_override.test.ts index 4895d9b4285..e2782c35119 100644 --- a/src/style/format_section_override.test.ts +++ b/src/style/format_section_override.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {EvaluationContext, FormattedSection, createExpression, StyleExpression, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec'; import properties from './style_layer/symbol_style_layer_properties.g'; import {PossiblyEvaluatedPropertyValue} from './properties'; diff --git a/src/style/light.test.ts b/src/style/light.test.ts index ea3e98b0ea0..a8a9dea1574 100644 --- a/src/style/light.test.ts +++ b/src/style/light.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Light} from './light'; import {Color, latest as styleSpec, LightSpecification} from '@maplibre/maplibre-gl-style-spec'; import {sphericalToCartesian} from '../util/util'; diff --git a/src/style/load_glyph_range.test.ts b/src/style/load_glyph_range.test.ts index 9718120fb95..610cb26959d 100644 --- a/src/style/load_glyph_range.test.ts +++ b/src/style/load_glyph_range.test.ts @@ -1,4 +1,3 @@ -import {test, expect, vi} from 'vitest'; import fs from 'fs'; import path from 'path'; import {RequestManager} from '../util/request_manager'; diff --git a/src/style/load_sprite.test.ts b/src/style/load_sprite.test.ts index 33be9ab063c..df1aee8318c 100644 --- a/src/style/load_sprite.test.ts +++ b/src/style/load_sprite.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import fs from 'fs'; import path from 'path'; import {RequestManager} from '../util/request_manager'; diff --git a/src/style/query_utils.test.ts b/src/style/query_utils.test.ts index cd3f7e74da9..718412e9f7f 100644 --- a/src/style/query_utils.test.ts +++ b/src/style/query_utils.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {offsetLine} from './query_utils'; diff --git a/src/style/style.test.ts b/src/style/style.test.ts index 8a542225a27..a8d4c437cc3 100644 --- a/src/style/style.test.ts +++ b/src/style/style.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {Style} from './style'; import {SourceCache} from '../source/source_cache'; import {StyleLayer} from './style_layer'; diff --git a/src/style/style_layer.test.ts b/src/style/style_layer.test.ts index 58f6fb8b2ab..1ef27ef2b5d 100644 --- a/src/style/style_layer.test.ts +++ b/src/style/style_layer.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {createStyleLayer} from './create_style_layer'; import {FillStyleLayer} from './style_layer/fill_style_layer'; import {extend} from '../util/util'; diff --git a/src/style/style_layer/fill_style_layer.test.ts b/src/style/style_layer/fill_style_layer.test.ts index 1096ad65069..3500f500261 100644 --- a/src/style/style_layer/fill_style_layer.test.ts +++ b/src/style/style_layer/fill_style_layer.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {getIntersectionDistance, Point3D} from './fill_extrusion_style_layer'; describe('getIntersectionDistance', () => { diff --git a/src/style/style_layer/line_style_layer.test.ts b/src/style/style_layer/line_style_layer.test.ts index 7aebdfb4524..4ad575b9941 100644 --- a/src/style/style_layer/line_style_layer.test.ts +++ b/src/style/style_layer/line_style_layer.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {createStyleLayer} from '../create_style_layer'; import {extend} from '../../util/util'; import {LineStyleLayer} from './line_style_layer'; diff --git a/src/style/style_layer/overlap_mode.test.ts b/src/style/style_layer/overlap_mode.test.ts index 768074b8dba..6c984b3590b 100644 --- a/src/style/style_layer/overlap_mode.test.ts +++ b/src/style/style_layer/overlap_mode.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {getOverlapMode} from './overlap_mode'; import {SymbolStyleLayer} from './symbol_style_layer'; import {ZoomHistory} from '../zoom_history'; diff --git a/src/style/style_layer/variable_text_anchor.test.ts b/src/style/style_layer/variable_text_anchor.test.ts index 4c7b7ed1dba..0a4af2a4a0d 100644 --- a/src/style/style_layer/variable_text_anchor.test.ts +++ b/src/style/style_layer/variable_text_anchor.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {EvaluationParameters} from '../evaluation_parameters'; import {ZoomHistory} from '../zoom_history'; import {SymbolStyleLayer} from './symbol_style_layer'; diff --git a/src/style/style_layer_index.test.ts b/src/style/style_layer_index.test.ts index e710cb75f6e..8d84e7a674f 100644 --- a/src/style/style_layer_index.test.ts +++ b/src/style/style_layer_index.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {mapObject} from '../util/util'; import {StyleLayerIndex} from './style_layer_index'; diff --git a/src/symbol/anchor.test.ts b/src/symbol/anchor.test.ts index fffb9d627d5..1e08a98427b 100644 --- a/src/symbol/anchor.test.ts +++ b/src/symbol/anchor.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {Anchor} from './anchor'; describe('Anchor', () => { diff --git a/src/symbol/check_max_angle.test.ts b/src/symbol/check_max_angle.test.ts index e187e1051a5..59e3244041f 100644 --- a/src/symbol/check_max_angle.test.ts +++ b/src/symbol/check_max_angle.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {checkMaxAngle} from './check_max_angle'; import {Anchor} from './anchor'; diff --git a/src/symbol/clip_line.test.ts b/src/symbol/clip_line.test.ts index 341288d66da..b9ba3b8aff7 100644 --- a/src/symbol/clip_line.test.ts +++ b/src/symbol/clip_line.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {clipLine} from './clip_line'; diff --git a/src/symbol/collision_feature.test.ts b/src/symbol/collision_feature.test.ts index 4bee15196fa..362ca96c48c 100644 --- a/src/symbol/collision_feature.test.ts +++ b/src/symbol/collision_feature.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {CollisionFeature} from './collision_feature'; import {Anchor} from './anchor'; import Point from '@mapbox/point-geometry'; diff --git a/src/symbol/collision_index.test.ts b/src/symbol/collision_index.test.ts index 6f03952fd7d..7f9ffff5db5 100644 --- a/src/symbol/collision_index.test.ts +++ b/src/symbol/collision_index.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {CollisionIndex} from './collision_index'; import {mat4} from 'gl-matrix'; diff --git a/src/symbol/cross_tile_symbol_index.test.ts b/src/symbol/cross_tile_symbol_index.test.ts index 9b25b1b69c9..cebbade3a41 100644 --- a/src/symbol/cross_tile_symbol_index.test.ts +++ b/src/symbol/cross_tile_symbol_index.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {CrossTileSymbolIndex, KDBUSH_THRESHHOLD} from './cross_tile_symbol_index'; import {OverscaledTileID} from '../source/tile_id'; import {StyleLayer} from '../style/style_layer'; diff --git a/src/symbol/get_anchors.test.ts b/src/symbol/get_anchors.test.ts index 68dfe8cd4f4..6d3c1ec26b0 100644 --- a/src/symbol/get_anchors.test.ts +++ b/src/symbol/get_anchors.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {getAnchors, getCenterAnchor} from './get_anchors'; import {PositionedIcon, Shaping} from './shaping'; diff --git a/src/symbol/grid_index.test.ts b/src/symbol/grid_index.test.ts index 9eb2e85f296..442fcf29b52 100644 --- a/src/symbol/grid_index.test.ts +++ b/src/symbol/grid_index.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {GridIndex} from './grid_index'; import type {GridKey} from './grid_index'; diff --git a/src/symbol/merge_lines.test.ts b/src/symbol/merge_lines.test.ts index b50e4b2e9e0..d4a51abbde6 100644 --- a/src/symbol/merge_lines.test.ts +++ b/src/symbol/merge_lines.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {mergeLines} from './merge_lines'; import Point from '@mapbox/point-geometry'; diff --git a/src/symbol/path_interpolator.test.ts b/src/symbol/path_interpolator.test.ts index c58e968d8eb..52251317a68 100644 --- a/src/symbol/path_interpolator.test.ts +++ b/src/symbol/path_interpolator.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {PathInterpolator} from './path_interpolator'; diff --git a/src/symbol/projection.test.ts b/src/symbol/projection.test.ts index 880a5f0fae6..94d8ad045d2 100644 --- a/src/symbol/projection.test.ts +++ b/src/symbol/projection.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {SymbolProjectionContext, ProjectionSyntheticVertexArgs, findOffsetIntersectionPoint, project, projectVertexToViewport, transformToOffsetNormal} from './projection'; import Point from '@mapbox/point-geometry'; diff --git a/src/symbol/quads.test.ts b/src/symbol/quads.test.ts index 3e9f43b2518..f592bc9bb6e 100644 --- a/src/symbol/quads.test.ts +++ b/src/symbol/quads.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {ImagePosition} from '../render/image_atlas'; import {getIconQuads} from './quads'; diff --git a/src/symbol/shaping.test.ts b/src/symbol/shaping.test.ts index 036c75259d5..c5b5ab17751 100644 --- a/src/symbol/shaping.test.ts +++ b/src/symbol/shaping.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {type PositionedIcon, type Box, type Shaping, applyTextFit, shapeIcon, fitIconToText} from './shaping'; import {ImagePosition} from '../render/image_atlas'; import {StyleImage, TextFit} from '../style/style_image'; diff --git a/src/symbol/symbol_style_layer.test.ts b/src/symbol/symbol_style_layer.test.ts index 5c8bf4775d5..979f732f33c 100644 --- a/src/symbol/symbol_style_layer.test.ts +++ b/src/symbol/symbol_style_layer.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer'; import {FormatSectionOverride} from '../style/format_section_override'; import properties, {SymbolPaintPropsPossiblyEvaluated} from '../style/style_layer/symbol_style_layer_properties.g'; diff --git a/src/ui/camera.test.ts b/src/ui/camera.test.ts index dfcdb810849..3476911eb56 100644 --- a/src/ui/camera.test.ts +++ b/src/ui/camera.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Camera, CameraOptions} from '../ui/camera'; import {Transform} from '../geo/transform'; import {TaskQueue, TaskID} from '../util/task_queue'; diff --git a/src/ui/control/attribution_control.test.ts b/src/ui/control/attribution_control.test.ts index e29dcf553b0..fdb4d07009b 100644 --- a/src/ui/control/attribution_control.test.ts +++ b/src/ui/control/attribution_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {AttributionControl, defaultAttributionControlOptions} from './attribution_control'; import {createMap as globalCreateMap, beforeMapTest, sleep} from '../../util/test/util'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/control/fullscreen_control.test.ts b/src/ui/control/fullscreen_control.test.ts index cbc3c37b979..446a8750139 100644 --- a/src/ui/control/fullscreen_control.test.ts +++ b/src/ui/control/fullscreen_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {FullscreenControl} from './fullscreen_control'; diff --git a/src/ui/control/geolocate_control.test.ts b/src/ui/control/geolocate_control.test.ts index 6f9052ca827..3d812704fa9 100644 --- a/src/ui/control/geolocate_control.test.ts +++ b/src/ui/control/geolocate_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import geolocation from 'mock-geolocation'; import {LngLatBounds} from '../../geo/lng_lat_bounds'; import {createMap, beforeMapTest, sleep} from '../../util/test/util'; diff --git a/src/ui/control/logo_control.test.ts b/src/ui/control/logo_control.test.ts index 6fcc8b105e7..71b29a1022c 100644 --- a/src/ui/control/logo_control.test.ts +++ b/src/ui/control/logo_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap as globalCreateMap, beforeMapTest} from '../../util/test/util'; function createMap(logoPosition, maplibreLogo) { diff --git a/src/ui/control/navigation_control.test.ts b/src/ui/control/navigation_control.test.ts index a9cf283d2bb..22c798f41f9 100644 --- a/src/ui/control/navigation_control.test.ts +++ b/src/ui/control/navigation_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import simulate from '../../../test/unit/lib/simulate_interaction'; import {createMap as globalCreateMap, beforeMapTest} from '../../util/test/util'; import {NavigationControl} from './navigation_control'; diff --git a/src/ui/control/scale_control.test.ts b/src/ui/control/scale_control.test.ts index 318fcecd682..fbe68e323d2 100644 --- a/src/ui/control/scale_control.test.ts +++ b/src/ui/control/scale_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {ScaleControl} from './scale_control'; diff --git a/src/ui/control/terrain_control.test.ts b/src/ui/control/terrain_control.test.ts index f68139a064c..8164a66a6d8 100644 --- a/src/ui/control/terrain_control.test.ts +++ b/src/ui/control/terrain_control.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect} from 'vitest'; import {TerrainControl} from './terrain_control'; import {createMap as globalCreateMap, beforeMapTest} from '../../util/test/util'; diff --git a/src/ui/handler/box_zoom.test.ts b/src/ui/handler/box_zoom.test.ts index b1b3af61398..c90cdacf30b 100644 --- a/src/ui/handler/box_zoom.test.ts +++ b/src/ui/handler/box_zoom.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Map} from '../map'; import {DOM} from '../../util/dom'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/handler/cooperative_gestures.test.ts b/src/ui/handler/cooperative_gestures.test.ts index a9193210383..f382f9f0368 100644 --- a/src/ui/handler/cooperative_gestures.test.ts +++ b/src/ui/handler/cooperative_gestures.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {browser} from '../../util/browser'; import {Map} from '../map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/handler/dblclick_zoom.test.ts b/src/ui/handler/dblclick_zoom.test.ts index 31476d883f8..c8d59b80205 100644 --- a/src/ui/handler/dblclick_zoom.test.ts +++ b/src/ui/handler/dblclick_zoom.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import simulate from '../../../test/unit/lib/simulate_interaction'; import {beforeMapTest, sleep} from '../../util/test/util'; import {Map, MapOptions} from '../map'; diff --git a/src/ui/handler/drag_pan.test.ts b/src/ui/handler/drag_pan.test.ts index 9d8b239f152..4feacc9a32d 100644 --- a/src/ui/handler/drag_pan.test.ts +++ b/src/ui/handler/drag_pan.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {DOM} from '../../util/dom'; import simulate from '../../../test/unit/lib/simulate_interaction'; import {beforeMapTest} from '../../util/test/util'; diff --git a/src/ui/handler/drag_rotate.test.ts b/src/ui/handler/drag_rotate.test.ts index 39f80a4f828..958ef2f129c 100644 --- a/src/ui/handler/drag_rotate.test.ts +++ b/src/ui/handler/drag_rotate.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {extend} from '../../util/util'; import {Map} from '../map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/handler/keyboard.test.ts b/src/ui/handler/keyboard.test.ts index 77db050d5a1..e811aea4152 100644 --- a/src/ui/handler/keyboard.test.ts +++ b/src/ui/handler/keyboard.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Map} from '../../ui/map'; import {DOM} from '../../util/dom'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/handler/map_event.test.ts b/src/ui/handler/map_event.test.ts index ee36d84f4b2..faebe0f64f6 100644 --- a/src/ui/handler/map_event.test.ts +++ b/src/ui/handler/map_event.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Map, MapOptions} from '../map'; import {DOM} from '../../util/dom'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/handler/mouse_handler_interface.test.ts b/src/ui/handler/mouse_handler_interface.test.ts index f0a3f2baf9c..6220cb6b56c 100644 --- a/src/ui/handler/mouse_handler_interface.test.ts +++ b/src/ui/handler/mouse_handler_interface.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {generateMousePanHandler, generateMousePitchHandler, generateMouseRotationHandler} from './mouse'; diff --git a/src/ui/handler/mouse_rotate.test.ts b/src/ui/handler/mouse_rotate.test.ts index 7df0b246ef8..9a2104ab2f4 100644 --- a/src/ui/handler/mouse_rotate.test.ts +++ b/src/ui/handler/mouse_rotate.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {extend} from '../../util/util'; import {Map} from '../../ui/map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts b/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts index 0517b3d260f..9eae8f2029b 100644 --- a/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts +++ b/src/ui/handler/one_finger_touch_drag_handler_interface.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {generateOneFingerTouchPitchHandler, generateOneFingerTouchRotationHandler} from './one_finger_touch_drag'; diff --git a/src/ui/handler/scroll_zoom.test.ts b/src/ui/handler/scroll_zoom.test.ts index 9e46e669823..ead8550c69e 100644 --- a/src/ui/handler/scroll_zoom.test.ts +++ b/src/ui/handler/scroll_zoom.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {browser} from '../../util/browser'; import {Map} from '../../ui/map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/handler/tap_drag_zoom.test.ts b/src/ui/handler/tap_drag_zoom.test.ts index d8bcc00adc3..1d2a6ba8624 100644 --- a/src/ui/handler/tap_drag_zoom.test.ts +++ b/src/ui/handler/tap_drag_zoom.test.ts @@ -1,6 +1,4 @@ - import {beforeMapTest, sleep} from '../../util/test/util'; -import {describe, beforeEach, test, expect, vi} from 'vitest'; import simulate from '../../../test/unit/lib/simulate_interaction'; import {Map, MapOptions} from '../map'; diff --git a/src/ui/handler/two_fingers_touch.test.ts b/src/ui/handler/two_fingers_touch.test.ts index 780c7a5cede..b5d57f0b8e5 100644 --- a/src/ui/handler/two_fingers_touch.test.ts +++ b/src/ui/handler/two_fingers_touch.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Map, MapOptions} from '../map'; import {Marker} from '../marker'; import {DOM} from '../../util/dom'; diff --git a/src/ui/hash.test.ts b/src/ui/hash.test.ts index f7711d92212..fa81342f82d 100644 --- a/src/ui/hash.test.ts +++ b/src/ui/hash.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect} from 'vitest'; import {Hash} from './hash'; import {createMap as globalCreateMap, beforeMapTest} from '../util/test/util'; import type {Map} from './map'; diff --git a/src/ui/map_tests/map_animation.test.ts b/src/ui/map_tests/map_animation.test.ts index 2218eaac3a0..1007b92bbc6 100644 --- a/src/ui/map_tests/map_animation.test.ts +++ b/src/ui/map_tests/map_animation.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/map_tests/map_basic.test.ts b/src/ui/map_tests/map_basic.test.ts index 20e1d41c5ef..adcfb4d49f0 100644 --- a/src/ui/map_tests/map_basic.test.ts +++ b/src/ui/map_tests/map_basic.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {Map, MapOptions} from '../map'; import {createMap, beforeMapTest, createStyle, createStyleSource} from '../../util/test/util'; import {Tile} from '../../source/tile'; diff --git a/src/ui/map_tests/map_bounds.test.ts b/src/ui/map_tests/map_bounds.test.ts index 25bc3f7b892..c1b09bb43dd 100644 --- a/src/ui/map_tests/map_bounds.test.ts +++ b/src/ui/map_tests/map_bounds.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {fixedLngLat, fixedNum} from '../../../test/unit/lib/fixed'; import {LngLatBoundsLike} from '../../geo/lng_lat_bounds'; diff --git a/src/ui/map_tests/map_calculate_camera_options.test.ts b/src/ui/map_tests/map_calculate_camera_options.test.ts index 889d6eb1452..113b2b7afe4 100644 --- a/src/ui/map_tests/map_calculate_camera_options.test.ts +++ b/src/ui/map_tests/map_calculate_camera_options.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {LngLat} from '../../geo/lng_lat'; import {OverscaledTileID} from '../../source/tile_id'; diff --git a/src/ui/map_tests/map_canvas.test.ts b/src/ui/map_tests/map_canvas.test.ts index 09ea53e8eb6..2168345e0ea 100644 --- a/src/ui/map_tests/map_canvas.test.ts +++ b/src/ui/map_tests/map_canvas.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_control.test.ts b/src/ui/map_tests/map_control.test.ts index 894839d748c..80a956fb793 100644 --- a/src/ui/map_tests/map_control.test.ts +++ b/src/ui/map_tests/map_control.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {IControl} from '../control/control'; diff --git a/src/ui/map_tests/map_disable_handlers.test.ts b/src/ui/map_tests/map_disable_handlers.test.ts index 4defa366eeb..1b082101e26 100644 --- a/src/ui/map_tests/map_disable_handlers.test.ts +++ b/src/ui/map_tests/map_disable_handlers.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_events.test.ts b/src/ui/map_tests/map_events.test.ts index 2704909931d..74173b06ace 100644 --- a/src/ui/map_tests/map_events.test.ts +++ b/src/ui/map_tests/map_events.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import simulate from '../../../test/unit/lib/simulate_interaction'; import {StyleLayer} from '../../style/style_layer'; import {createMap, beforeMapTest, createStyle} from '../../util/test/util'; diff --git a/src/ui/map_tests/map_feature_state.test.ts b/src/ui/map_tests/map_feature_state.test.ts index 1275de4c640..b3160b81693 100644 --- a/src/ui/map_tests/map_feature_state.test.ts +++ b/src/ui/map_tests/map_feature_state.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest, createStyleSource} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_images.test.ts b/src/ui/map_tests/map_images.test.ts index 2d13cc5c119..c2261e39d74 100644 --- a/src/ui/map_tests/map_images.test.ts +++ b/src/ui/map_tests/map_images.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {StyleImageInterface} from '../../style/style_image'; diff --git a/src/ui/map_tests/map_is_moving.test.ts b/src/ui/map_tests/map_is_moving.test.ts index d7ab43a43e0..56fd5c2c76c 100644 --- a/src/ui/map_tests/map_is_moving.test.ts +++ b/src/ui/map_tests/map_is_moving.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {browser} from '../../util/browser'; import {Map} from '../map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/map_tests/map_is_rotating.test.ts b/src/ui/map_tests/map_is_rotating.test.ts index 7c4973c0999..043a4246526 100644 --- a/src/ui/map_tests/map_is_rotating.test.ts +++ b/src/ui/map_tests/map_is_rotating.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {Map} from '../map'; import {DOM} from '../../util/dom'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/map_tests/map_is_zooming.test.ts b/src/ui/map_tests/map_is_zooming.test.ts index 6dc38511c44..15f7d56c2df 100644 --- a/src/ui/map_tests/map_is_zooming.test.ts +++ b/src/ui/map_tests/map_is_zooming.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {browser} from '../../util/browser'; import {Map} from '../map'; import {DOM} from '../../util/dom'; diff --git a/src/ui/map_tests/map_layer.test.ts b/src/ui/map_tests/map_layer.test.ts index 1437f5d37c7..efdfeef7c5a 100644 --- a/src/ui/map_tests/map_layer.test.ts +++ b/src/ui/map_tests/map_layer.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect} from 'vitest'; import {createMap, beforeMapTest, createStyle} from '../../util/test/util'; import {extend} from '../../util/util'; import {EvaluationParameters} from '../../style/evaluation_parameters'; diff --git a/src/ui/map_tests/map_options.test.ts b/src/ui/map_tests/map_options.test.ts index d33a3b4fefb..9bc71951c24 100644 --- a/src/ui/map_tests/map_options.test.ts +++ b/src/ui/map_tests/map_options.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest, createStyle} from '../../util/test/util'; import {EvaluationParameters} from '../../style/evaluation_parameters'; import {Style} from '../../style/style'; diff --git a/src/ui/map_tests/map_pitch.test.ts b/src/ui/map_tests/map_pitch.test.ts index 6e6e552a1ce..9f7987bf189 100644 --- a/src/ui/map_tests/map_pitch.test.ts +++ b/src/ui/map_tests/map_pitch.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_pixel_ratio.test.ts b/src/ui/map_tests/map_pixel_ratio.test.ts index cbb1febd827..bbdf6bd98b1 100644 --- a/src/ui/map_tests/map_pixel_ratio.test.ts +++ b/src/ui/map_tests/map_pixel_ratio.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_query_rendered_features.test.ts b/src/ui/map_tests/map_query_rendered_features.test.ts index 6d03aa3aa24..b0ace9f4796 100644 --- a/src/ui/map_tests/map_query_rendered_features.test.ts +++ b/src/ui/map_tests/map_query_rendered_features.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {LngLat} from '../../geo/lng_lat'; diff --git a/src/ui/map_tests/map_render.test.ts b/src/ui/map_tests/map_render.test.ts index dbbd858b755..a0b0770b079 100644 --- a/src/ui/map_tests/map_render.test.ts +++ b/src/ui/map_tests/map_render.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, afterEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest, createStyle} from '../../util/test/util'; import {fakeServer, FakeServer} from 'nise'; diff --git a/src/ui/map_tests/map_request_render_frame.test.ts b/src/ui/map_tests/map_request_render_frame.test.ts index dedfc36fcfe..33403fca560 100644 --- a/src/ui/map_tests/map_request_render_frame.test.ts +++ b/src/ui/map_tests/map_request_render_frame.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_resize.test.ts b/src/ui/map_tests/map_resize.test.ts index a02562043e6..1c1138425c6 100644 --- a/src/ui/map_tests/map_resize.test.ts +++ b/src/ui/map_tests/map_resize.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest, sleep} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_style.test.ts b/src/ui/map_tests/map_style.test.ts index daf25b155ac..c36f1802acc 100644 --- a/src/ui/map_tests/map_style.test.ts +++ b/src/ui/map_tests/map_style.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {Map, MapOptions} from '../map'; import {createMap, beforeMapTest, createStyle, createStyleSource} from '../../util/test/util'; import {Event as EventedEvent} from '../../util/evented'; diff --git a/src/ui/map_tests/map_terrian.test.ts b/src/ui/map_tests/map_terrian.test.ts index 20711521910..d5312809b2e 100644 --- a/src/ui/map_tests/map_terrian.test.ts +++ b/src/ui/map_tests/map_terrian.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import {LngLat} from '../../geo/lng_lat'; import {fakeServer, FakeServer} from 'nise'; diff --git a/src/ui/map_tests/map_webgl.test.ts b/src/ui/map_tests/map_webgl.test.ts index 7078bcf093b..1bc5617dae5 100644 --- a/src/ui/map_tests/map_webgl.test.ts +++ b/src/ui/map_tests/map_webgl.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect, vi} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_world_copies.test.ts b/src/ui/map_tests/map_world_copies.test.ts index 81f15f72a10..6ec34b2f6fb 100644 --- a/src/ui/map_tests/map_world_copies.test.ts +++ b/src/ui/map_tests/map_world_copies.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; beforeEach(() => { diff --git a/src/ui/map_tests/map_zoom.test.ts b/src/ui/map_tests/map_zoom.test.ts index 593e3d2a83d..4fef8107475 100644 --- a/src/ui/map_tests/map_zoom.test.ts +++ b/src/ui/map_tests/map_zoom.test.ts @@ -1,4 +1,3 @@ -import {beforeEach, test, expect} from 'vitest'; import {createMap, beforeMapTest} from '../../util/test/util'; import simulate from '../../../test/unit/lib/simulate_interaction'; diff --git a/src/ui/marker.test.ts b/src/ui/marker.test.ts index 56cb530f0e8..0ff6e31d886 100644 --- a/src/ui/marker.test.ts +++ b/src/ui/marker.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap as globalCreateMap, beforeMapTest, sleep} from '../util/test/util'; import {Marker} from './marker'; import {Popup} from './popup'; diff --git a/src/ui/popup.test.ts b/src/ui/popup.test.ts index 9c984aea7e2..a84402790aa 100644 --- a/src/ui/popup.test.ts +++ b/src/ui/popup.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {createMap as globalCreateMap, beforeMapTest} from '../util/test/util'; import {Popup, Offset} from './popup'; import {LngLat} from '../geo/lng_lat'; diff --git a/src/util/actor.test.ts b/src/util/actor.test.ts index 7b11a95faad..b0eb93dcf69 100644 --- a/src/util/actor.test.ts +++ b/src/util/actor.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeAll, afterAll, test, expect, vi} from 'vitest'; import {Actor, ActorTarget} from './actor'; import {WorkerGlobalScopeInterface, workerFactory} from './web_worker'; import {setGlobalWorker} from '../../test/unit/lib/web_worker_mock'; diff --git a/src/util/ajax.test.ts b/src/util/ajax.test.ts index 566668ce2bf..69f0b3f3f11 100644 --- a/src/util/ajax.test.ts +++ b/src/util/ajax.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import { getArrayBuffer, getJSON, diff --git a/src/util/browser.test.ts b/src/util/browser.test.ts index dcef4c6472b..ac047252f70 100644 --- a/src/util/browser.test.ts +++ b/src/util/browser.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {browser} from './browser'; describe('browser', () => { diff --git a/src/util/color_ramp.test.ts b/src/util/color_ramp.test.ts index 00ae94a2ccd..275d444045a 100644 --- a/src/util/color_ramp.test.ts +++ b/src/util/color_ramp.test.ts @@ -1,5 +1,3 @@ -import {describe, test, expect} from 'vitest'; - import {renderColorRamp} from './color_ramp'; import {createPropertyExpression, StylePropertyExpression, StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec'; diff --git a/src/util/dispatcher.test.ts b/src/util/dispatcher.test.ts index 6707efddad4..49cd8d0f54d 100644 --- a/src/util/dispatcher.test.ts +++ b/src/util/dispatcher.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Actor} from './actor'; import {Dispatcher} from './dispatcher'; import {workerFactory} from './web_worker'; diff --git a/src/util/evented.test.ts b/src/util/evented.test.ts index 3b930b08e34..0640230bbb8 100644 --- a/src/util/evented.test.ts +++ b/src/util/evented.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {Event, Evented} from './evented'; describe('Evented', () => { diff --git a/src/util/find_pole_of_inaccessibility.test.ts b/src/util/find_pole_of_inaccessibility.test.ts index cecd1305916..dfea4f0e76a 100644 --- a/src/util/find_pole_of_inaccessibility.test.ts +++ b/src/util/find_pole_of_inaccessibility.test.ts @@ -1,4 +1,3 @@ -import {test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {findPoleOfInaccessibility} from './find_pole_of_inaccessibility'; diff --git a/src/util/geolocation_support.test.ts b/src/util/geolocation_support.test.ts index d7a3f7cdbe2..aabf44508b9 100644 --- a/src/util/geolocation_support.test.ts +++ b/src/util/geolocation_support.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import {checkGeolocationSupport} from './geolocation_support'; describe('checkGeolocationSupport', () => { diff --git a/src/util/image_request.test.ts b/src/util/image_request.test.ts index c38715bde61..625d328ccc7 100644 --- a/src/util/image_request.test.ts +++ b/src/util/image_request.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, afterEach, test, expect, vi} from 'vitest'; import {config} from './config'; import {webpSupported} from './webp_supported'; import {sleep, stubAjaxGetImage} from './test/util'; diff --git a/src/util/is_char_in_unicode_block.test.ts b/src/util/is_char_in_unicode_block.test.ts index 88410c2022f..1611274cdc4 100644 --- a/src/util/is_char_in_unicode_block.test.ts +++ b/src/util/is_char_in_unicode_block.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {unicodeBlockLookup} from './is_char_in_unicode_block'; describe('unicodeBlockLookup', () => { diff --git a/src/util/offscreen_canvas_distorted.test.ts b/src/util/offscreen_canvas_distorted.test.ts index 0a1534d890c..88b88c02e06 100644 --- a/src/util/offscreen_canvas_distorted.test.ts +++ b/src/util/offscreen_canvas_distorted.test.ts @@ -1,4 +1,3 @@ -import {test, expect, vi} from 'vitest'; import {isOffscreenCanvasDistorted} from './offscreen_canvas_distorted'; import {Canvas} from 'canvas'; import {offscreenCanvasSupported} from './offscreen_canvas_supported'; diff --git a/src/util/primitives.test.ts b/src/util/primitives.test.ts index 94f213f4909..aa6c40b7529 100644 --- a/src/util/primitives.test.ts +++ b/src/util/primitives.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {Aabb, Frustum} from './primitives'; import {mat4, vec3, vec4} from 'gl-matrix'; diff --git a/src/util/resolve_tokens.test.ts b/src/util/resolve_tokens.test.ts index 5c58381085e..ed9fbe88b93 100644 --- a/src/util/resolve_tokens.test.ts +++ b/src/util/resolve_tokens.test.ts @@ -1,4 +1,3 @@ -import {test, expect} from 'vitest'; import {resolveTokens} from './resolve_tokens'; test('resolveToken', () => { diff --git a/src/util/script_detection.test.ts b/src/util/script_detection.test.ts index 276368d644c..7e3f5a350dd 100644 --- a/src/util/script_detection.test.ts +++ b/src/util/script_detection.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {charAllowsIdeographicBreaking, charAllowsLetterSpacing, charHasUprightVerticalOrientation, charInComplexShapingScript, charInRTLScript} from './script_detection'; describe('charAllowsIdeographicBreaking', () => { diff --git a/src/util/smart_wrap.test.ts b/src/util/smart_wrap.test.ts index 2b57b822944..44c8ef230d0 100644 --- a/src/util/smart_wrap.test.ts +++ b/src/util/smart_wrap.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import Point from '@mapbox/point-geometry'; import {LngLat} from '../geo/lng_lat'; import {Transform} from '../geo/transform'; diff --git a/src/util/struct_array.test.ts b/src/util/struct_array.test.ts index 5dcd39c6617..77e2d1616b1 100644 --- a/src/util/struct_array.test.ts +++ b/src/util/struct_array.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {StructArrayLayout3i6, FeatureIndexArray} from '../data/array_types.g'; describe('StructArray', () => { diff --git a/src/util/style.test.ts b/src/util/style.test.ts index b108f287a4b..305c8cf4815 100644 --- a/src/util/style.test.ts +++ b/src/util/style.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {coerceSpriteToArray} from './style'; describe('style utils', () => { diff --git a/src/util/task_queue.test.ts b/src/util/task_queue.test.ts index 1b4d0b1d4af..9a326c86ef8 100644 --- a/src/util/task_queue.test.ts +++ b/src/util/task_queue.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect, vi} from 'vitest'; import {TaskQueue} from './task_queue'; describe('TaskQueue', () => { diff --git a/src/util/test/util.ts b/src/util/test/util.ts index 22822c6413e..146a96a8340 100644 --- a/src/util/test/util.ts +++ b/src/util/test/util.ts @@ -1,4 +1,3 @@ -import {vi} from 'vitest'; import {Map} from '../../ui/map'; import {extend} from '../../util/util'; import {Dispatcher} from '../../util/dispatcher'; diff --git a/src/util/throttle.test.ts b/src/util/throttle.test.ts index c0a4276b54f..88eea13f45f 100644 --- a/src/util/throttle.test.ts +++ b/src/util/throttle.test.ts @@ -1,5 +1,4 @@ import {sleep} from './test/util'; -import {describe, test, expect} from 'vitest'; import {throttle} from './throttle'; describe('throttle', () => { diff --git a/src/util/transferable_grid_index.test.ts b/src/util/transferable_grid_index.test.ts index 741815facb4..b2f71bf2555 100644 --- a/src/util/transferable_grid_index.test.ts +++ b/src/util/transferable_grid_index.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {TransferableGridIndex} from './transferable_grid_index'; describe('TransferableGridIndex', () => { diff --git a/src/util/util.test.ts b/src/util/util.test.ts index e752c97aa71..a1a8e9452bd 100644 --- a/src/util/util.test.ts +++ b/src/util/util.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, test, expect, vi} from 'vitest'; import Point from '@mapbox/point-geometry'; import {arraysIntersect, bezier, clamp, clone, deepEqual, easeCubicInOut, extend, filterObject, findLineIntersection, isCounterClockwise, isPowerOfTwo, keysDifference, mapObject, nextPowerOfTwo, parseCacheControl, pick, readImageDataUsingOffscreenCanvas, readImageUsingVideoFrame, uniqueId, wrap} from './util'; import {Canvas} from 'canvas'; diff --git a/src/util/web_worker_transfer.test.ts b/src/util/web_worker_transfer.test.ts index f7512c38ccc..4969e0dc97b 100644 --- a/src/util/web_worker_transfer.test.ts +++ b/src/util/web_worker_transfer.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {SerializedObject} from '../../dist/maplibre-gl'; import {AJAXError} from './ajax'; import {register, serialize, deserialize} from './web_worker_transfer'; diff --git a/src/util/worker_pool.test.ts b/src/util/worker_pool.test.ts index afaba35b599..5f73a43d88e 100644 --- a/src/util/worker_pool.test.ts +++ b/src/util/worker_pool.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {WorkerPool} from './worker_pool'; describe('WorkerPool', () => { diff --git a/src/util/world_bounds.test.ts b/src/util/world_bounds.test.ts index 49c3267b694..6714716d2ba 100644 --- a/src/util/world_bounds.test.ts +++ b/src/util/world_bounds.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import {isInBoundsForTileZoomXY, isInBoundsForZoomLngLat} from './world_bounds'; import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from './util'; import {LngLat} from '../geo/lng_lat'; diff --git a/test/build/dev.test.ts b/test/build/dev.test.ts index d6d7a94a91b..acb5b8a5b09 100644 --- a/test/build/dev.test.ts +++ b/test/build/dev.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import fs from 'fs'; describe('dev build', () => { diff --git a/test/build/import.test.ts b/test/build/import.test.ts index 8e923500d31..f0d04a2ea1a 100644 --- a/test/build/import.test.ts +++ b/test/build/import.test.ts @@ -1,4 +1,3 @@ -import {describe, expect, it} from 'vitest'; import {LngLat} from '../../dist/maplibre-gl'; describe('Importing a class', () => { diff --git a/test/build/min.test.ts b/test/build/min.test.ts index 1a4a87aaace..5d2b7cbcc27 100644 --- a/test/build/min.test.ts +++ b/test/build/min.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import fs from 'fs'; import packageJson from '../../package.json' with { type: 'json' }; diff --git a/test/integration/symbol-shaping/shaping.test.ts b/test/integration/symbol-shaping/shaping.test.ts index 4dbf84e47bd..fca54cd0fda 100644 --- a/test/integration/symbol-shaping/shaping.test.ts +++ b/test/integration/symbol-shaping/shaping.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import fs from 'fs'; import path from 'path'; import {WritingMode, shapeText, Shaping} from '../../../src/symbol/shaping'; diff --git a/tsconfig.jest.json b/tsconfig.jest.json deleted file mode 100644 index 620d3ea8381..00000000000 --- a/tsconfig.jest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "target": "ES2019" - } -} diff --git a/tsconfig.json b/tsconfig.json index 471e3483be5..7fc28150363 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,7 +22,8 @@ ], "types": [ "geojson", - "offscreencanvas" + "offscreencanvas", + "vitest/globals" ] }, "ts-node": { @@ -39,7 +40,8 @@ "rollup.config.*", "src/**/*", "test/bench/**/*", - "test/integration/**/*" + "test/integration/**/*", + "test/build/**/*" ], "exclude": [ "node_modules", diff --git a/vitest.config.unit.ts b/vitest.config.unit.ts index ca4858571bf..687658cfbd8 100644 --- a/vitest.config.unit.ts +++ b/vitest.config.unit.ts @@ -2,6 +2,7 @@ import {defineConfig} from 'vitest/config'; export default defineConfig({ test: { + globals: true, name: 'unit', environment: 'jsdom', setupFiles: [ From 0520ed3d2871b97f3e49f1f218da01c755041192 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Fri, 20 Sep 2024 16:01:17 +0200 Subject: [PATCH 2/5] use globals --- test/build/sourcemaps.test.ts | 1 - test/integration/browser/browser.test.ts | 1 - test/integration/query/query.test.ts | 2 -- 3 files changed, 4 deletions(-) diff --git a/test/build/sourcemaps.test.ts b/test/build/sourcemaps.test.ts index 6ded823609b..039a05fe46d 100644 --- a/test/build/sourcemaps.test.ts +++ b/test/build/sourcemaps.test.ts @@ -1,4 +1,3 @@ -import {describe, test, expect} from 'vitest'; import packageJson from '../../package.json' with {type: 'json'}; import {globSync, glob} from 'glob'; import path, {dirname} from 'path'; diff --git a/test/integration/browser/browser.test.ts b/test/integration/browser/browser.test.ts index 19469e6ec0f..0872ac6c113 100644 --- a/test/integration/browser/browser.test.ts +++ b/test/integration/browser/browser.test.ts @@ -1,4 +1,3 @@ -import {describe, beforeEach, beforeAll, afterEach, afterAll, test, expect} from 'vitest'; import puppeteer, {Page, Browser} from 'puppeteer'; import st from 'st'; import http, {type Server} from 'http'; diff --git a/test/integration/query/query.test.ts b/test/integration/query/query.test.ts index 9581c5a58f4..ce83c1b7f2d 100644 --- a/test/integration/query/query.test.ts +++ b/test/integration/query/query.test.ts @@ -1,5 +1,3 @@ -import {describe, beforeEach, beforeAll, afterEach, afterAll, test, expect} from 'vitest'; - import puppeteer, {Page, Browser} from 'puppeteer'; import {deepEqual} from '../lib/json-diff'; From f80ff550346f907c3e8bdbb850195ac709223850 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Fri, 20 Sep 2024 16:02:18 +0200 Subject: [PATCH 3/5] type {Mock} --- src/render/draw_custom.test.ts | 2 +- src/render/draw_fill.test.ts | 2 +- src/render/draw_symbol.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/render/draw_custom.test.ts b/src/render/draw_custom.test.ts index 22274694b5b..d4bd2cac76d 100644 --- a/src/render/draw_custom.test.ts +++ b/src/render/draw_custom.test.ts @@ -7,7 +7,7 @@ import type {Map} from '../ui/map'; import {Transform} from '../geo/transform'; import {drawCustom} from './draw_custom'; import {CustomStyleLayer} from '../style/style_layer/custom_style_layer'; -import {Mock} from 'vitest'; +import type {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); diff --git a/src/render/draw_fill.test.ts b/src/render/draw_fill.test.ts index 9300f2b9d5c..67ef2de88fe 100644 --- a/src/render/draw_fill.test.ts +++ b/src/render/draw_fill.test.ts @@ -14,7 +14,7 @@ import {FillStyleLayer} from '../style/style_layer/fill_style_layer'; import {drawFill} from './draw_fill'; import {FillBucket} from '../data/bucket/fill_bucket'; import {ProgramConfiguration, ProgramConfigurationSet} from '../data/program_configuration'; -import {Mock} from 'vitest'; +import type {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); diff --git a/src/render/draw_symbol.test.ts b/src/render/draw_symbol.test.ts index 12d4aee0168..8787c797e3f 100644 --- a/src/render/draw_symbol.test.ts +++ b/src/render/draw_symbol.test.ts @@ -14,7 +14,7 @@ import {Transform} from '../geo/transform'; import type {EvaluationParameters} from '../style/evaluation_parameters'; import type {SymbolLayerSpecification} from '@maplibre/maplibre-gl-style-spec'; import {Style} from '../style/style'; -import {Mock} from 'vitest'; +import type {Mock} from 'vitest'; vi.mock('./painter'); vi.mock('./program'); From 961f87d4f8e5a71e7397643e699cf1dd6c05715d Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Fri, 20 Sep 2024 16:04:44 +0200 Subject: [PATCH 4/5] new option syntax --- test/integration/browser/browser.test.ts | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/test/integration/browser/browser.test.ts b/test/integration/browser/browser.test.ts index 0872ac6c113..0627843723f 100644 --- a/test/integration/browser/browser.test.ts +++ b/test/integration/browser/browser.test.ts @@ -64,7 +64,7 @@ describe('Browser tests', () => { } }, 40000); - test('Load should fire before resize and moveend', async () => { + test('Load should fire before resize and moveend', {retry: 3, timeout: 20000}), async () => { const firstFiredEvent = await page.evaluate(() => { const map2 = new maplibregl.Map({ container: 'map', @@ -79,9 +79,9 @@ describe('Browser tests', () => { }); }); expect(firstFiredEvent).toBe('load'); - }, {retry: 3, timeout: 20000}); + }; - test('Should continue zooming from last mouse position after scroll and flyto, see #2709', async () => { + test('Should continue zooming from last mouse position after scroll and flyto, see #2709', {retry: 3, timeout: 20000}, async () => { const finalZoom = await page.evaluate(() => { return new Promise((resolve, _reject) => { map.once('zoom', () => { @@ -99,9 +99,9 @@ describe('Browser tests', () => { }); }); expect(finalZoom).toBeGreaterThan(2); - }, {retry: 3, timeout: 20000}); + }); - test('Drag to the left', async () => { + test('Drag to the left', {retry: 3, timeout: 20000}, async () => { const canvas = await page.$('.maplibregl-canvas'); const canvasBB = await canvas?.boundingBox(); @@ -132,9 +132,9 @@ describe('Browser tests', () => { const centerWithInertia = await dragToLeft(); expect(centerWithInertia.lng).toBeLessThan(-60); expect(centerWithInertia.lat).toBeCloseTo(0, 7); - }, {retry: 3, timeout: 20000}); + }); - test('Resize viewport (page)', async () => { + test('Resize viewport (page)', {retry: 3, timeout: 20000}, async () => { await page.setViewport({width: 400, height: 400, deviceScaleFactor: 2}); @@ -144,9 +144,9 @@ describe('Browser tests', () => { const canvasBB = await canvas?.boundingBox(); expect(canvasBB?.width).toBeCloseTo(400); expect(canvasBB?.height).toBeCloseTo(400); - }, {retry: 3, timeout: 20000}); + }); - test('Resize div', async () => { + test('Resize div', {retry: 3, timeout: 20000}, async () => { await page.evaluate(() => { document.getElementById('map')!.style.width = '200px'; @@ -158,9 +158,9 @@ describe('Browser tests', () => { const canvasBB = await canvas?.boundingBox(); expect(canvasBB!.width).toBeCloseTo(200); expect(canvasBB!.height).toBeCloseTo(200); - }, {retry: 3, timeout: 20000}); + }); - test('Zoom: Double click at the center', async () => { + test('Zoom: Double click at the center', {retry: 3, timeout: 20000}, async () => { const canvas = await page.$('.maplibregl-canvas'); const canvasBB = await canvas?.boundingBox()!; @@ -174,9 +174,9 @@ describe('Browser tests', () => { }); expect(zoom).toBe(2); - }, {retry: 3, timeout: 20000}); + }); - test('Marker scaled: correct drag', async () => { + test('Marker scaled: correct drag', {retry: 3}, async () => { await page.evaluate(() => { document.getElementById('map')!.style.transform = 'scale(0.5)'; const markerMapPosition = map.getCenter(); @@ -204,9 +204,9 @@ describe('Browser tests', () => { const newPosition = await dragToLeft(); expect(newPosition.x).toBeCloseTo(0); expect(newPosition.y).toBeCloseTo(0); - }, {retry: 3}); + }); - test('Marker: correct position', async () => { + test('Marker: correct position', {retry: 3, timeout: 20000}, async () => { const markerScreenPosition = await page.evaluate(() => { const markerMapPosition = [11.40, 47.30] as [number, number]; const marker = new maplibregl.Marker() @@ -280,9 +280,9 @@ describe('Browser tests', () => { expect(markerScreenPosition.x).toBeCloseTo(386.5); expect(markerScreenPosition.y).toBeCloseTo(378.1); - }, {retry: 3, timeout: 20000}); + }); - test('Fullscreen control should work in shadowdom as well', async () => { + test('Fullscreen control should work in shadowdom as well', {retry: 3, timeout: 20000}, async () => { const fullscreenButtonTitle = await page.evaluate(async () => { function sleepInBrowser(milliseconds: number) { return new Promise(resolve => setTimeout(resolve, milliseconds)); @@ -339,9 +339,9 @@ describe('Browser tests', () => { }); expect(fullscreenButtonTitle).toBe('Exit fullscreen'); - }, {retry: 3, timeout: 20000}); + }); - test('Marker: correct opacity after resize with 3d terrain', async () => { + test('Marker: correct opacity after resize with 3d terrain', {retry: 3, timeout: 20000}, async () => { const markerOpacity = await page.evaluate(() => { const marker = new maplibregl.Marker() .setLngLat(map.getCenter()) @@ -388,7 +388,7 @@ describe('Browser tests', () => { }); expect(markerOpacity).toBe('1'); - }, {retry: 3, timeout: 20000}); + }); test('Load map with RTL plugin should throw exception for invalid URL', async () => { @@ -405,7 +405,7 @@ describe('Browser tests', () => { }, 2000); - test('Movement with transformCameraUpdate and terrain', async () => { + test('Movement with transformCameraUpdate and terrain', {retry: 3, timeout: 20000}, async () => { await page.evaluate(async () => { map.setPitch(52) .setZoom(15) @@ -444,5 +444,5 @@ describe('Browser tests', () => { }); expect(center.lng).toBeCloseTo(11.39770); expect(center.lat).toBeCloseTo(47.29960); - }, {retry: 3, timeout: 20000}); + }); }); From 04941a1b015bd3d58c7f537f13bf0b6ddcf369ae Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Fri, 20 Sep 2024 16:10:49 +0200 Subject: [PATCH 5/5] fix syntax --- test/integration/browser/browser.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/browser/browser.test.ts b/test/integration/browser/browser.test.ts index 0627843723f..377f50559a7 100644 --- a/test/integration/browser/browser.test.ts +++ b/test/integration/browser/browser.test.ts @@ -64,7 +64,7 @@ describe('Browser tests', () => { } }, 40000); - test('Load should fire before resize and moveend', {retry: 3, timeout: 20000}), async () => { + test('Load should fire before resize and moveend', {retry: 3, timeout: 20000}, async () => { const firstFiredEvent = await page.evaluate(() => { const map2 = new maplibregl.Map({ container: 'map', @@ -79,7 +79,7 @@ describe('Browser tests', () => { }); }); expect(firstFiredEvent).toBe('load'); - }; + }); test('Should continue zooming from last mouse position after scroll and flyto, see #2709', {retry: 3, timeout: 20000}, async () => { const finalZoom = await page.evaluate(() => {