Tests: tile-based output optional, will require custom libvips

The prebuilt binaries provided by v0.32.0 will not support
tile-based output, which is (hopefully) a temporary situation
until upstream licensing issues are resolved.
This commit is contained in:
Lovell Fuller 2023-03-21 21:19:53 +00:00
parent a44da850c1
commit 8b8a815fbb
2 changed files with 650 additions and 640 deletions

View File

@ -56,6 +56,9 @@ Requires libvips v8.14.0
* Ensure all async JS callbacks are wrapped to help avoid possible race condition. * Ensure all async JS callbacks are wrapped to help avoid possible race condition.
[#3569](https://github.com/lovell/sharp/issues/3569) [#3569](https://github.com/lovell/sharp/issues/3569)
* Prebuilt binaries: support for tile-based output temporarily removed due to licensing issue.
[#3581](https://github.com/lovell/sharp/issues/3581)
* Add support to `normalise` for `lower` and `upper` percentiles. * Add support to `normalise` for `lower` and `upper` percentiles.
[#3583](https://github.com/lovell/sharp/pull/3583) [#3583](https://github.com/lovell/sharp/pull/3583)
[@LachlanNewman](https://github.com/LachlanNewman) [@LachlanNewman](https://github.com/LachlanNewman)

View File

@ -220,21 +220,16 @@ describe('Tile', function () {
it('Valid depths pass', function () { it('Valid depths pass', function () {
['onepixel', 'onetile', 'one'].forEach(function (depth) { ['onepixel', 'onetile', 'one'].forEach(function (depth) {
assert.doesNotThrow(function (depth) { assert.doesNotThrow(() => sharp().tile({ depth }));
sharp().tile({
depth: depth
});
});
}); });
}); });
it('Invalid depths fail', function () { it('Invalid depths fail', function () {
['depth', 1].forEach(function (depth) { ['depth', 1].forEach(function (depth) {
assert.throws(function () { assert.throws(
sharp().tile({ () => sharp().tile({ depth }),
depth: depth /Expected one of: onepixel, onetile, one for depth but received/
}); );
});
}); });
}); });
@ -295,12 +290,17 @@ describe('Tile', function () {
}); });
}); });
it('Invalid center parameter value fail', function () { it('Valid center parameter value passes', function () {
assert.throws(function () { assert.doesNotThrow(
sharp().tile({ () => sharp().tile({ center: true })
centre: 'true' );
});
}); });
it('Invalid centre parameter value fails', function () {
assert.throws(
() => sharp().tile({ centre: 'true' }),
/Expected boolean for tileCentre but received true of type string/
);
}); });
it('Valid id parameter value passes', function () { it('Valid id parameter value passes', function () {
@ -319,14 +319,20 @@ describe('Tile', function () {
}); });
}); });
it('Invalid basename parameter value fails', function () { it('Valid basename parameter value passes', function () {
assert.throws(function () { assert.doesNotThrow(
sharp().tile({ () => sharp().tile({ basename: 'pass' })
basename: true );
});
});
}); });
it('Invalid basename parameter value fails', function () {
assert.throws(
() => sharp().tile({ basename: true }),
/Expected string for basename but received/
);
});
if (sharp.format.dz.output.file) {
it('Deep Zoom layout', function (done) { it('Deep Zoom layout', function (done) {
const directory = fixtures.path('output.dzi_files'); const directory = fixtures.path('output.dzi_files');
fs.rm(directory, { recursive: true }, function () { fs.rm(directory, { recursive: true }, function () {
@ -991,4 +997,5 @@ describe('Tile', function () {
}); });
}); });
}); });
}
}); });