unit tests added

This commit is contained in:
Sebastian 2019-07-11 15:52:28 +02:00
parent 546a7f82a3
commit 89396ebe44

View File

@ -32,4 +32,19 @@ describe('PDFDocument', () => {
expect(fontSpy).not.toBeCalled();
});
});
describe('document info', () => {
test('accepts properties with value undefined', () => {
expect(() => new PDFDocument({ info: { Title: undefined }}))
.not.toThrow(new TypeError("Cannot read property 'toString' of undefined"));
});
test('accepts properties with value null', () => {
expect(() => new PDFDocument({ info: { Title: null }}))
.not.toThrow(new TypeError("Cannot read property 'toString' of null"));
});
});
});