Skip to content

Commit 36fcf24

Browse files
committed
Setup tests properly
1 parent c0c26c7 commit 36fcf24

17 files changed

+119763
-48121
lines changed

.github/workflows/node.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Node
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
10+
- name: Setup Node
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: 18
14+
15+
- name: Install dependencies
16+
run: npm install
17+
18+
- name: Build the bundle
19+
run: npm run build
20+
21+
- name: Run tests
22+
run: npm test

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v0.0.4
2+
- Add handling for null geometries
3+
14
# v0.0.3
25
- Add support for MultiLinestring
36
- Rejigging bundling

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ A library for converting an [arcgis-pbf](https://github.com/Esri/arcgis-pbf) int
33

44
By itself it doesn't do much but you can find a more complex example of it's usage is in my mapbox-gl-arcgis-featureserver library.
55

6+
[![Build Status](https://github.com/rowanwins/arcgis-pbf-parser/workflows/Node/badge.svg?branch=master)](https://github.com/rowanwins/arcgis-pbf-parser/actions)
7+
[![minzipped size](https://badgen.net/bundlephobia/minzip/arcgis-pbf-parser)](https://esm.run/arcgis-pbf-parser)
8+
69
## Basic Usage
710
````
811
const arcgisPbfDecode = require('arcgis-pbf-parser')
@@ -31,6 +34,7 @@ The decode method returns an object containing the featureCollection, and a bool
3134
This was cobbled together fairly quickly based on the [minimal documentation](https://github.com/Esri/arcgis-pbf/tree/main/proto/FeatureCollection) available.
3235

3336

37+
3438
### Done
3539
- Polgon
3640
- Inc MultiPolygon
@@ -39,10 +43,11 @@ This was cobbled together fairly quickly based on the [minimal documentation](ht
3943
- Inc MultiLineString
4044
- Point
4145
- Attributes
46+
- Features with null geometries
4247

4348
### To Do
4449
- MultiPoint (a sample service would be helpful)
45-
- Write proper tests
50+
- Improve tests
4651

4752

4853
## Acknowledgements

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"scripts": {
1919
"build": "rollup -c",
20-
"test": "echo \"Error: no test specified\" && exit 1"
20+
"test": "node test/test.js"
2121
},
2222
"repository": {
2323
"type": "git",
@@ -35,7 +35,11 @@
3535
"eslint": "^7.26.0",
3636
"eslint-config-mourner": "^3.0.0",
3737
"esm": "^3.2.25",
38+
"glob": "^10.0.0",
39+
"load-json-file": "^7.0.1",
3840
"rollup": "^2.48.0",
39-
"rollup-plugin-terser": "^7.0.2"
41+
"rollup-plugin-terser": "^7.0.2",
42+
"tape": "^5.6.3",
43+
"write-json-file": "^5.0.0"
4044
}
4145
}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
{
2+
"featureCollection": {
3+
"type": "FeatureCollection",
4+
"features": [
5+
{
6+
"type": "Feature",
7+
"id": 153752,
8+
"properties": {
9+
"D_BI_RT_NAME": "Ramblin' River Tour",
10+
"OBJECTID": 153752
11+
},
12+
"geometry": {
13+
"type": "LineString",
14+
"coordinates": [
15+
[
16+
-9904404.3770804,
17+
4449246.542425363
18+
],
19+
[
20+
-9904710.12519354,
21+
4451463.216245633
22+
],
23+
[
24+
-9904633.688165255,
25+
4451998.275443628
26+
],
27+
[
28+
-9904480.814108685,
29+
4452304.02355677
30+
],
31+
[
32+
-9903563.569769263,
33+
4453144.830867906
34+
],
35+
[
36+
-9902569.888401555,
37+
4455055.756575035
38+
],
39+
[
40+
-9899053.785100438,
41+
4463998.888884398
42+
],
43+
[
44+
-9897983.666704446,
45+
4463540.266714687
46+
],
47+
[
48+
-9898060.103732731,
49+
4463234.518601547
50+
],
51+
[
52+
-9897448.60750645,
53+
4463005.207516692
54+
]
55+
]
56+
}
57+
},
58+
{
59+
"type": "Feature",
60+
"id": 154013,
61+
"properties": {
62+
"D_BI_RT_NAME": "Ramblin' River Tour",
63+
"OBJECTID": 154013
64+
},
65+
"geometry": {
66+
"type": "LineString",
67+
"coordinates": [
68+
[
69+
-9897448.60750645,
70+
4463005.207516692
71+
],
72+
[
73+
-9895002.622601325,
74+
4462164.400205554
75+
],
76+
[
77+
-9895079.05962961,
78+
4461858.652092414
79+
],
80+
[
81+
-9894696.874488184,
82+
4461705.778035844
83+
],
84+
[
85+
-9894620.4374599,
86+
4461552.9039792735
87+
],
88+
[
89+
-9894314.689346759,
90+
4461552.9039792735
91+
],
92+
[
93+
-9894161.815290188,
94+
4461476.466950988
95+
],
96+
[
97+
-9893703.193120478,
98+
4461323.592894418
99+
],
100+
[
101+
-9893321.007979052,
102+
4461017.844781278
103+
],
104+
[
105+
-9892785.948781056,
106+
4460406.348554996
107+
],
108+
[
109+
-9892174.452554774,
110+
4460177.0374701405
111+
],
112+
[
113+
-9891945.141469918,
114+
4460024.16341357
115+
],
116+
[
117+
-9891027.897130497,
118+
4459794.852328715
119+
],
120+
[
121+
-9889881.34170622,
122+
4459412.667187289
123+
],
124+
[
125+
-9888352.601140516,
126+
4459336.230159004
127+
],
128+
[
129+
-9888123.29005566,
130+
4459259.793130719
131+
],
132+
[
133+
-9886900.297603099,
134+
4458113.237706441
135+
],
136+
[
137+
-9886059.490291962,
138+
4456890.245253879
139+
],
140+
[
141+
-9885830.179207107,
142+
4456737.371197308
143+
],
144+
[
145+
-9884148.564584833,
146+
4456049.437942742
147+
],
148+
[
149+
-9883995.690528262,
150+
4455896.563886172
151+
],
152+
[
153+
-9883919.253499977,
154+
4455361.504688175
155+
],
156+
[
157+
-9883842.816471692,
158+
4455208.630631605
159+
],
160+
[
161+
-9882925.57213227,
162+
4454597.134405324
163+
]
164+
]
165+
}
166+
}
167+
]
168+
},
169+
"exceededTransferLimit": false
170+
}

0 commit comments

Comments
 (0)