forked from vbuch/node-signpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignPdfError.test.js
More file actions
26 lines (25 loc) · 805 Bytes
/
Copy pathSignPdfError.test.js
File metadata and controls
26 lines (25 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import SignPdfError, {
ERROR_TYPE_UNKNOWN,
ERROR_TYPE_INPUT,
ERROR_TYPE_PARSE,
} from './SignPdfError';
describe('SignPdfError', () => {
it('SignPdfError extends Error', () => {
const instance = new SignPdfError('Whatever message');
expect(instance instanceof Error).toBe(true);
});
it('type defaults to UNKNOWN', () => {
const instance = new SignPdfError('Whatever message');
expect(instance.type).toBe(ERROR_TYPE_UNKNOWN);
});
it('type can be specified', () => {
[
ERROR_TYPE_UNKNOWN,
ERROR_TYPE_INPUT,
ERROR_TYPE_PARSE,
].forEach((type) => {
const instance = new SignPdfError('Whatever message', type);
expect(instance.type).toBe(type);
});
});
});