Skip to content

Commit

Permalink
tests: Migrate unit tests to Vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Dec 15, 2024
1 parent 89bb618 commit d997740
Show file tree
Hide file tree
Showing 21 changed files with 5,368 additions and 10,639 deletions.
3 changes: 0 additions & 3 deletions jest.config.json

This file was deleted.

15,705 changes: 5,213 additions & 10,492 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build:demo-webpack": "cd demo-rollup && npm install && npm run build",
"changelog": "conventional-changelog --infile CHANGELOG.md --same-file --output-unreleased",
"doc": "typedoc --mode file --excludePrivate --stripInternal --moduleResolution node --out docs/ src/",
"test": "jest",
"test": "vitest run --dom",
"lint": "eslint --ext .js,.ts ."
},
"repository": {
Expand Down Expand Up @@ -68,14 +68,14 @@
"conventional-changelog-cli": "^2.1.0",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^26.6.3",
"happy-dom": "^15.11.7",
"leaflet": "^1.6.0",
"microbundle": "^0.13.0",
"prettier": "^1.19.1",
"ts-jest": "^26.4.4",
"tslib": "^1.11.1",
"typedoc": "^0.19.2",
"typescript": "^3.8.3"
"typescript": "^3.8.3",
"vitest": "^2.1.8"
},
"peerDependencies": {
"leaflet": "^1.6.0"
Expand Down
20 changes: 10 additions & 10 deletions spec/__snapshots__/arcgis.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`L.Control.Geocoder.ArcGis geocodes Innsbruck 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.ArcGis > geocodes Innsbruck 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 47.34400000000003,
"lng": 11.467300000000058,
},
"_southWest": Object {
"_southWest": {
"lat": 47.19200000000003,
"lng": 11.315300000000057,
},
},
"center": Object {
"center": {
"lat": 47.26800000000003,
"lng": 11.391300000000058,
},
Expand Down
38 changes: 19 additions & 19 deletions spec/__snapshots__/google.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`L.Control.Geocoder.Google geocodes Innsbruck 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.Google > geocodes Innsbruck 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 47.3599301,
"lng": 11.45593,
},
"_southWest": Object {
"_southWest": {
"lat": 47.21098000000001,
"lng": 11.3016499,
},
},
"center": Object {
"center": {
"lat": 47.2692124,
"lng": 11.4041024,
},
"name": "Innsbruck, Austria",
"properties": Array [
Object {
"properties": [
{
"long_name": "Innsbruck",
"short_name": "Innsbruck",
"types": Array [
"types": [
"locality",
"political",
],
},
Object {
{
"long_name": "Innsbruck",
"short_name": "Innsbruck",
"types": Array [
"types": [
"administrative_area_level_2",
"political",
],
},
Object {
{
"long_name": "Tyrol",
"short_name": "Tyrol",
"types": Array [
"types": [
"administrative_area_level_1",
"political",
],
},
Object {
{
"long_name": "Austria",
"short_name": "AT",
"types": Array [
"types": [
"country",
"political",
],
Expand Down
50 changes: 25 additions & 25 deletions spec/__snapshots__/here.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`L.Control.Geocoder.HERE geocodes Innsbruck 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.HERE > geocodes Innsbruck 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 47.35922,
"lng": 11.45587,
},
"_southWest": Object {
"_southWest": {
"lat": 47.21082,
"lng": 11.30194,
},
},
"center": Object {
"center": {
"lat": 47.268,
"lng": 11.3913,
},
"name": "Innsbruck, Tirol, Österreich",
"properties": Object {
"additionalData": Array [
Object {
"properties": {
"additionalData": [
{
"key": "CountryName",
"value": "Österreich",
},
Object {
{
"key": "StateName",
"value": "Tirol",
},
Object {
{
"key": "CountyName",
"value": "Innsbruck-Stadt",
},
Expand All @@ -48,27 +48,27 @@ Array [
]
`;

exports[`L.Control.Geocoder.HEREv2 geocodes Innsbruck 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.HEREv2 > geocodes Innsbruck 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 42.36355,
"lng": -71.05439,
},
"_southWest": Object {
"_southWest": {
"lat": 42.36355,
"lng": -71.05439,
},
},
"center": Object {
"center": {
"lat": 42.36355,
"lng": -71.05439,
},
"name": "Salumeria Italiana, 151 Richmond St, Boston, MA 02109, United States",
"properties": Object {
"properties": {
"city": "Boston",
"countryCode": "USA",
"countryName": "United States",
Expand Down
22 changes: 11 additions & 11 deletions spec/__snapshots__/mapbox.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`L.Control.Geocoder.Mapbox geocodes Milwaukee Ave 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.Mapbox > geocodes Milwaukee Ave 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 42.166602,
"lng": -87.921434,
},
"_southWest": Object {
"_southWest": {
"lat": 42.166602,
"lng": -87.921434,
},
},
"center": Object {
"center": {
"lat": 42.166602,
"lng": -87.921434,
},
"name": "825 Milwaukee Ave, Deerfield, Illinois 60015, United States",
"properties": Object {
"properties": {
"address": "825",
"country": "United States",
"countryShortCode": "us",
Expand Down
54 changes: 27 additions & 27 deletions spec/__snapshots__/nominatim.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`L.Control.Geocoder.Nominatim geocodes Innsbruck 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.Nominatim > geocodes Innsbruck 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 47.2808566,
"lng": 11.418183,
},
"_southWest": Object {
"_southWest": {
"lat": 47.2583715,
"lng": 11.3811871,
},
},
"center": Object {
"center": {
"lat": 47.26951525,
"lng": 11.3971372042211,
},
"html": "<span class=\\"\\"> Innsbruck </span><br/><span class=\\"leaflet-control-geocoder-address-context\\">Tyrol Austria</span>",
"html": "<span class=""> Innsbruck </span><br/><span class="leaflet-control-geocoder-address-context">Tyrol Austria</span>",
"icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png",
"name": "Innsbruck, Tyrol, Austria",
"properties": Object {
"address": Object {
"properties": {
"address": {
"city": "Innsbruck",
"city_district": "Innsbruck",
"country": "Austria",
"country_code": "at",
"county": "Innsbruck",
"state": "Tyrol",
},
"boundingbox": Array [
"boundingbox": [
47.2583715,
47.2808566,
11.3811871,
Expand All @@ -55,35 +55,35 @@ Array [
]
`;

exports[`L.Control.Geocoder.Nominatim reverse geocodes 47.3/11.3 1`] = `
Array [
Array [
Array [
Object {
"bbox": Object {
"_northEast": Object {
exports[`L.Control.Geocoder.Nominatim > reverse geocodes 47.3/11.3 1`] = `
[
[
[
{
"bbox": {
"_northEast": {
"lat": 47.2065094,
"lng": 11.3836945900354,
},
"_southWest": Object {
"_southWest": {
"lat": 47.2065094,
"lng": 11.3836945900354,
},
},
"center": Object {
"center": {
"lat": 47.2065094,
"lng": 11.3836945900354,
},
"html": "<span class=\\"\\">Tyrol Austria</span>",
"html": "<span class="">Tyrol Austria</span>",
"name": "Innsbruck-Land, Tyrol, Austria",
"properties": Object {
"address": Object {
"properties": {
"address": {
"country": "Austria",
"country_code": "at",
"county": "Innsbruck-Land",
"state": "Tyrol",
},
"boundingbox": Array [
"boundingbox": [
"46.9624854",
"47.4499229",
"10.9896868",
Expand Down
Loading

0 comments on commit d997740

Please sign in to comment.