UNPKG

@pdfme/pdf-lib

Version:

Create and modify PDF files with JavaScript

27 lines 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("../../../src/core"); const utils_1 = require("../../../src/utils"); describe(`PDFNull`, () => { it(`cannot be publicly constructed`, () => { expect(() => new core_1.PDFNull()).toThrow(); }); it(`can be converted to null`, () => { expect(core_1.PDFNull.asNull()).toBe(null); }); it(`can be cloned`, () => { expect(core_1.PDFNull.clone()).toBe(core_1.PDFNull); }); it(`can be converted to a string`, () => { expect(String(core_1.PDFNull)).toBe('null'); }); it(`can provide its size in bytes`, () => { expect(core_1.PDFNull.sizeInBytes()).toBe(4); }); it(`can be serialized`, () => { const buffer = new Uint8Array(8).fill((0, utils_1.toCharCode)(' ')); expect(core_1.PDFNull.copyBytesInto(buffer, 3)).toBe(4); expect(buffer).toEqual((0, utils_1.typedArrayFor)(' null ')); }); }); //# sourceMappingURL=PDFNull.spec.js.map