Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('h3SetToFeature - nested donut', assert => {
const middle = '89283082877ffff';
const hexagons = h3.hexRing(middle, 1).concat(h3.hexRing(middle, 3));
const feature = h3SetToFeature(hexagons);
const coords = feature.geometry.coordinates;
assert.strictEqual(coords.length, 2, 'expected polygon count');
assert.strictEqual(coords[0].length, 2, 'expected loop count for p1');
assert.strictEqual(coords[1].length, 2, 'expected loop count for p2');
assert.strictEqual(coords[0][0].length, 6 * 3 + 1, 'expected outer coord count p1');
assert.strictEqual(coords[0][1].length, 7, 'expected inner coord count p1');
assert.strictEqual(coords[1][0].length, 6 * 7 + 1, 'expected outer coord count p2');
assert.strictEqual(coords[1][1].length, 6 * 5 + 1, 'expected inner coord count p2');
assert.end();
});