Skip to content

Commit

Permalink
Added extra unit test for the metaChannelCount property.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Aug 17, 2024
1 parent 84c50a9 commit 0e3dfc7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/magick-image/meta-channel-count.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Licensed under the Apache License, Version 2.0.
*/

import { MagickFormat } from '@src/enums/magick-format';
import { TestImages } from '@test/test-images';

describe('MagickImage#metaChannelCount', () => {
Expand All @@ -23,4 +24,17 @@ describe('MagickImage#metaChannelCount', () => {
expect(() => image.metaChannelCount = 54).toThrowError('MaximumChannelsExceeded');
})
});

it('should save extra channels in a TIFF file', () => {
TestImages.imageMagickJpg.use(input => {
input.metaChannelCount = 2;

input.write(MagickFormat.Tiff, (data) => {
TestImages.empty.use((output) => {
output.read(data);
expect(output.metaChannelCount).toBe(2);
});
});
});
});
});

0 comments on commit 0e3dfc7

Please sign in to comment.