Skip to content

Commit

Permalink
100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
brahima committed Jul 18, 2022
1 parent 63d25f9 commit 5f95c81
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/unit/text.js
Expand Up @@ -174,6 +174,16 @@ describe('Text to image', () => {
});
});

it('fontfile input', function () {
// Added for code coverage
sharp({
text: {
text: 'text',
fontfile: 'UnknownFont.ttf'
}
});
});

it('bad font input', function () {
assert.throws(function () {
sharp({
Expand Down Expand Up @@ -229,6 +239,17 @@ describe('Text to image', () => {
});
});

it('bad justify input', function () {
assert.throws(function () {
sharp({
text: {
text: 'text',
justify: 'unknown'
}
});
});
});

it('bad dpi input', function () {
assert.throws(function () {
sharp({
Expand Down

0 comments on commit 5f95c81

Please sign in to comment.