@pgpm/geotypes 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Makefile
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/geotypes",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "Geographic data types and spatial functions for PostgreSQL",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"test:watch": "jest --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pgpm/types": "0.15.
|
|
25
|
-
"@pgpm/verify": "0.15.
|
|
24
|
+
"@pgpm/types": "0.15.4",
|
|
25
|
+
"@pgpm/verify": "0.15.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"pgpm": "^1.
|
|
28
|
+
"pgpm": "^1.2.2"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/constructive-io/pgpm-modules/issues"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "aad0dbef0336d6c18d027120ef9addc418822edd"
|
|
39
39
|
}
|
package/pgpm-geo-types.control
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { getConnections, PgTestClient } from 'pgsql-test';
|
|
2
|
-
|
|
3
|
-
jest.setTimeout(15000);
|
|
4
|
-
|
|
5
|
-
let pg: PgTestClient;
|
|
6
|
-
let teardown: () => Promise<void>;
|
|
7
|
-
|
|
8
|
-
beforeAll(async () => {
|
|
9
|
-
({ pg, teardown } = await getConnections());
|
|
10
|
-
|
|
11
|
-
await pg.any(`
|
|
12
|
-
CREATE TABLE places (
|
|
13
|
-
id serial PRIMARY KEY,
|
|
14
|
-
loc geolocation,
|
|
15
|
-
area geopolygon
|
|
16
|
-
);
|
|
17
|
-
`);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
afterAll(async () => {
|
|
21
|
-
await teardown();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe('places table (geotypes)', () => {
|
|
25
|
-
it('inserts valid point and polygon', async () => {
|
|
26
|
-
await expect(pg.any(`
|
|
27
|
-
INSERT INTO places (loc, area)
|
|
28
|
-
VALUES (
|
|
29
|
-
ST_SetSRID(ST_MakePoint(-122.4194, 37.7749), 4326),
|
|
30
|
-
ST_SetSRID(
|
|
31
|
-
ST_GeomFromText('POLYGON((-122.5 37.7, -122.4 37.7, -122.4 37.8, -122.5 37.8, -122.5 37.7))'),
|
|
32
|
-
4326
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
`)).resolves.not.toThrow();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('fails if point SRID is incorrect', async () => {
|
|
39
|
-
await expect(pg.any(`
|
|
40
|
-
INSERT INTO places (loc)
|
|
41
|
-
VALUES (
|
|
42
|
-
ST_SetSRID(ST_MakePoint(-122.4194, 37.7749), 3857)
|
|
43
|
-
);
|
|
44
|
-
`)).rejects.toThrow();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('fails if polygon is invalid', async () => {
|
|
48
|
-
await expect(pg.any(`
|
|
49
|
-
INSERT INTO places (area)
|
|
50
|
-
VALUES (
|
|
51
|
-
ST_SetSRID(ST_GeomFromText('POLYGON((0 0, 1 1, 2 2))'), 4326)
|
|
52
|
-
);
|
|
53
|
-
`)).rejects.toThrow();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
File without changes
|