forked from topojson/topojson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransform-properties-test.js
53 lines (50 loc) · 1.24 KB
/
transform-properties-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var vows = require("vows"),
assert = require("assert"),
transformProperties = require("../lib/topojson/transform-properties");
var suite = vows.describe("transform-properties");
suite.addBatch({
"transform-properties": {
"by default, deletes properties from Features": function() {
assert.deepEqual(transformProperties({
foo: {
type: "Feature",
properties: {"foo": 42},
geometry: {
type: "LineString",
coordinates: [0]
}
}
}).foo, {
type: "Feature",
geometry: {
type: "LineString",
coordinates: [0]
}
});
},
"observes the specified property transform function": function() {
assert.deepEqual(transformProperties({
foo: {
type: "Feature",
properties: {"foo": 42},
geometry: {
type: "LineString",
coordinates: [0]
}
}
}, function(object) {
return {
bar: object.properties.foo
};
}).foo, {
type: "Feature",
properties: {"bar": 42},
geometry: {
type: "LineString",
coordinates: [0]
}
});
}
}
});
suite.export(module);