Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 040c789

Browse files
committed
test: 🧪 create a test for encoded file compressPDF
1 parent f4b8b16 commit 040c789

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/index.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,12 @@ describe('isValidPDF', () => {
115115

116116

117117
describe('compressPDF', () => {
118-
test('returns PDF reduce size', async () => {
118+
test('returns PDF reduce size send buffer file', async () => {
119119
const optimizedPDF = await gs.compressPDF(files['pdf3.pdf'])
120120
expect(optimizedPDF.length).toBeLessThanOrEqual(files['pdf3.pdf'].length);
121121
});
122+
test('returns PDF reduce size send string encoded file', async () => {
123+
const optimizedPDF = await gs.compressPDF(files['pdf3.pdf'].toString('base64'))
124+
expect(optimizedPDF.length).toBeLessThanOrEqual(files['pdf3.pdf'].length);
125+
});
122126
})

0 commit comments

Comments
 (0)