Skip to content

Commit

Permalink
Fix tile overlap test callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyguts committed Oct 30, 2019
1 parent 1dd68ab commit b029c29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/unit/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const assertGoogleTiles = function (directory, expectedTileSize, expectedLevels,
};

// Verifies tiles at specified level in a given output directory are > size+overlap
const assertTileOverlap = function (directory, tileSize) {
const assertTileOverlap = function (directory, tileSize, done) {
// Get sorted levels
const levels = fs.readdirSync(directory).sort((a, b) => a - b);
// Select the highest tile level
Expand All @@ -109,6 +109,7 @@ const assertTileOverlap = function (directory, tileSize) {
// Tile with an overlap should be larger than original size
assert.strictEqual(true, metadata.width > tileSize);
assert.strictEqual(true, metadata.height > tileSize);
done();
}
});
};
Expand Down Expand Up @@ -319,8 +320,9 @@ describe('Tile', function () {
assert.strictEqual(2225, info.height);
assert.strictEqual(3, info.channels);
assert.strictEqual('undefined', typeof info.size);
assertTileOverlap(directory, 512);
assertDeepZoomTiles(directory, 512 + (2 * 16), 13, done);
assertDeepZoomTiles(directory, 512 + (2 * 16), 13, function () {
assertTileOverlap(directory, 512, done);
});
});
});
});
Expand Down

0 comments on commit b029c29

Please sign in to comment.