Skip to content

Commit d997740

Browse files
committed
tests: Migrate unit tests to Vitest
1 parent 89bb618 commit d997740

21 files changed

Lines changed: 5368 additions & 10639 deletions

‎jest.config.json‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎package-lock.json‎

Lines changed: 5213 additions & 10492 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"build:demo-webpack": "cd demo-rollup && npm install && npm run build",
1919
"changelog": "conventional-changelog --infile CHANGELOG.md --same-file --output-unreleased",
2020
"doc": "typedoc --mode file --excludePrivate --stripInternal --moduleResolution node --out docs/ src/",
21-
"test": "jest",
21+
"test": "vitest run --dom",
2222
"lint": "eslint --ext .js,.ts ."
2323
},
2424
"repository": {
@@ -68,14 +68,14 @@
6868
"conventional-changelog-cli": "^2.1.0",
6969
"eslint": "^6.8.0",
7070
"eslint-plugin-prettier": "^3.1.2",
71-
"jest": "^26.6.3",
71+
"happy-dom": "^15.11.7",
7272
"leaflet": "^1.6.0",
7373
"microbundle": "^0.13.0",
7474
"prettier": "^1.19.1",
75-
"ts-jest": "^26.4.4",
7675
"tslib": "^1.11.1",
7776
"typedoc": "^0.19.2",
78-
"typescript": "^3.8.3"
77+
"typescript": "^3.8.3",
78+
"vitest": "^2.1.8"
7979
},
8080
"peerDependencies": {
8181
"leaflet": "^1.6.0"

‎spec/__snapshots__/arcgis.spec.ts.snap‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`L.Control.Geocoder.ArcGis geocodes Innsbruck 1`] = `
4-
Array [
5-
Array [
6-
Array [
7-
Object {
8-
"bbox": Object {
9-
"_northEast": Object {
3+
exports[`L.Control.Geocoder.ArcGis > geocodes Innsbruck 1`] = `
4+
[
5+
[
6+
[
7+
{
8+
"bbox": {
9+
"_northEast": {
1010
"lat": 47.34400000000003,
1111
"lng": 11.467300000000058,
1212
},
13-
"_southWest": Object {
13+
"_southWest": {
1414
"lat": 47.19200000000003,
1515
"lng": 11.315300000000057,
1616
},
1717
},
18-
"center": Object {
18+
"center": {
1919
"lat": 47.26800000000003,
2020
"lng": 11.391300000000058,
2121
},

‎spec/__snapshots__/google.spec.ts.snap‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`L.Control.Geocoder.Google geocodes Innsbruck 1`] = `
4-
Array [
5-
Array [
6-
Array [
7-
Object {
8-
"bbox": Object {
9-
"_northEast": Object {
3+
exports[`L.Control.Geocoder.Google > geocodes Innsbruck 1`] = `
4+
[
5+
[
6+
[
7+
{
8+
"bbox": {
9+
"_northEast": {
1010
"lat": 47.3599301,
1111
"lng": 11.45593,
1212
},
13-
"_southWest": Object {
13+
"_southWest": {
1414
"lat": 47.21098000000001,
1515
"lng": 11.3016499,
1616
},
1717
},
18-
"center": Object {
18+
"center": {
1919
"lat": 47.2692124,
2020
"lng": 11.4041024,
2121
},
2222
"name": "Innsbruck, Austria",
23-
"properties": Array [
24-
Object {
23+
"properties": [
24+
{
2525
"long_name": "Innsbruck",
2626
"short_name": "Innsbruck",
27-
"types": Array [
27+
"types": [
2828
"locality",
2929
"political",
3030
],
3131
},
32-
Object {
32+
{
3333
"long_name": "Innsbruck",
3434
"short_name": "Innsbruck",
35-
"types": Array [
35+
"types": [
3636
"administrative_area_level_2",
3737
"political",
3838
],
3939
},
40-
Object {
40+
{
4141
"long_name": "Tyrol",
4242
"short_name": "Tyrol",
43-
"types": Array [
43+
"types": [
4444
"administrative_area_level_1",
4545
"political",
4646
],
4747
},
48-
Object {
48+
{
4949
"long_name": "Austria",
5050
"short_name": "AT",
51-
"types": Array [
51+
"types": [
5252
"country",
5353
"political",
5454
],

‎spec/__snapshots__/here.spec.ts.snap‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`L.Control.Geocoder.HERE geocodes Innsbruck 1`] = `
4-
Array [
5-
Array [
6-
Array [
7-
Object {
8-
"bbox": Object {
9-
"_northEast": Object {
3+
exports[`L.Control.Geocoder.HERE > geocodes Innsbruck 1`] = `
4+
[
5+
[
6+
[
7+
{
8+
"bbox": {
9+
"_northEast": {
1010
"lat": 47.35922,
1111
"lng": 11.45587,
1212
},
13-
"_southWest": Object {
13+
"_southWest": {
1414
"lat": 47.21082,
1515
"lng": 11.30194,
1616
},
1717
},
18-
"center": Object {
18+
"center": {
1919
"lat": 47.268,
2020
"lng": 11.3913,
2121
},
2222
"name": "Innsbruck, Tirol, Österreich",
23-
"properties": Object {
24-
"additionalData": Array [
25-
Object {
23+
"properties": {
24+
"additionalData": [
25+
{
2626
"key": "CountryName",
2727
"value": "Österreich",
2828
},
29-
Object {
29+
{
3030
"key": "StateName",
3131
"value": "Tirol",
3232
},
33-
Object {
33+
{
3434
"key": "CountyName",
3535
"value": "Innsbruck-Stadt",
3636
},
@@ -48,27 +48,27 @@ Array [
4848
]
4949
`;
5050

51-
exports[`L.Control.Geocoder.HEREv2 geocodes Innsbruck 1`] = `
52-
Array [
53-
Array [
54-
Array [
55-
Object {
56-
"bbox": Object {
57-
"_northEast": Object {
51+
exports[`L.Control.Geocoder.HEREv2 > geocodes Innsbruck 1`] = `
52+
[
53+
[
54+
[
55+
{
56+
"bbox": {
57+
"_northEast": {
5858
"lat": 42.36355,
5959
"lng": -71.05439,
6060
},
61-
"_southWest": Object {
61+
"_southWest": {
6262
"lat": 42.36355,
6363
"lng": -71.05439,
6464
},
6565
},
66-
"center": Object {
66+
"center": {
6767
"lat": 42.36355,
6868
"lng": -71.05439,
6969
},
7070
"name": "Salumeria Italiana, 151 Richmond St, Boston, MA 02109, United States",
71-
"properties": Object {
71+
"properties": {
7272
"city": "Boston",
7373
"countryCode": "USA",
7474
"countryName": "United States",

‎spec/__snapshots__/mapbox.spec.ts.snap‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`L.Control.Geocoder.Mapbox geocodes Milwaukee Ave 1`] = `
4-
Array [
5-
Array [
6-
Array [
7-
Object {
8-
"bbox": Object {
9-
"_northEast": Object {
3+
exports[`L.Control.Geocoder.Mapbox > geocodes Milwaukee Ave 1`] = `
4+
[
5+
[
6+
[
7+
{
8+
"bbox": {
9+
"_northEast": {
1010
"lat": 42.166602,
1111
"lng": -87.921434,
1212
},
13-
"_southWest": Object {
13+
"_southWest": {
1414
"lat": 42.166602,
1515
"lng": -87.921434,
1616
},
1717
},
18-
"center": Object {
18+
"center": {
1919
"lat": 42.166602,
2020
"lng": -87.921434,
2121
},
2222
"name": "825 Milwaukee Ave, Deerfield, Illinois 60015, United States",
23-
"properties": Object {
23+
"properties": {
2424
"address": "825",
2525
"country": "United States",
2626
"countryShortCode": "us",

‎spec/__snapshots__/nominatim.spec.ts.snap‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`L.Control.Geocoder.Nominatim geocodes Innsbruck 1`] = `
4-
Array [
5-
Array [
6-
Array [
7-
Object {
8-
"bbox": Object {
9-
"_northEast": Object {
3+
exports[`L.Control.Geocoder.Nominatim > geocodes Innsbruck 1`] = `
4+
[
5+
[
6+
[
7+
{
8+
"bbox": {
9+
"_northEast": {
1010
"lat": 47.2808566,
1111
"lng": 11.418183,
1212
},
13-
"_southWest": Object {
13+
"_southWest": {
1414
"lat": 47.2583715,
1515
"lng": 11.3811871,
1616
},
1717
},
18-
"center": Object {
18+
"center": {
1919
"lat": 47.26951525,
2020
"lng": 11.3971372042211,
2121
},
22-
"html": "<span class=\\"\\"> Innsbruck </span><br/><span class=\\"leaflet-control-geocoder-address-context\\">Tyrol Austria</span>",
22+
"html": "<span class=""> Innsbruck </span><br/><span class="leaflet-control-geocoder-address-context">Tyrol Austria</span>",
2323
"icon": "https://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png",
2424
"name": "Innsbruck, Tyrol, Austria",
25-
"properties": Object {
26-
"address": Object {
25+
"properties": {
26+
"address": {
2727
"city": "Innsbruck",
2828
"city_district": "Innsbruck",
2929
"country": "Austria",
3030
"country_code": "at",
3131
"county": "Innsbruck",
3232
"state": "Tyrol",
3333
},
34-
"boundingbox": Array [
34+
"boundingbox": [
3535
47.2583715,
3636
47.2808566,
3737
11.3811871,
@@ -55,35 +55,35 @@ Array [
5555
]
5656
`;
5757

58-
exports[`L.Control.Geocoder.Nominatim reverse geocodes 47.3/11.3 1`] = `
59-
Array [
60-
Array [
61-
Array [
62-
Object {
63-
"bbox": Object {
64-
"_northEast": Object {
58+
exports[`L.Control.Geocoder.Nominatim > reverse geocodes 47.3/11.3 1`] = `
59+
[
60+
[
61+
[
62+
{
63+
"bbox": {
64+
"_northEast": {
6565
"lat": 47.2065094,
6666
"lng": 11.3836945900354,
6767
},
68-
"_southWest": Object {
68+
"_southWest": {
6969
"lat": 47.2065094,
7070
"lng": 11.3836945900354,
7171
},
7272
},
73-
"center": Object {
73+
"center": {
7474
"lat": 47.2065094,
7575
"lng": 11.3836945900354,
7676
},
77-
"html": "<span class=\\"\\">Tyrol Austria</span>",
77+
"html": "<span class="">Tyrol Austria</span>",
7878
"name": "Innsbruck-Land, Tyrol, Austria",
79-
"properties": Object {
80-
"address": Object {
79+
"properties": {
80+
"address": {
8181
"country": "Austria",
8282
"country_code": "at",
8383
"county": "Innsbruck-Land",
8484
"state": "Tyrol",
8585
},
86-
"boundingbox": Array [
86+
"boundingbox": [
8787
"46.9624854",
8888
"47.4499229",
8989
"10.9896868",

0 commit comments

Comments
 (0)