Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Lib-PDF
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
JS Toolbox
Lib-PDF
Merge requests
!1
Draft: Resolve "[Document Sealing] Implement PDF parser"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Resolve "[Document Sealing] Implement PDF parser"
1-document-sealing-implement-pdf-parser
into
master
Overview
0
Commits
26
Pipelines
24
Changes
43
Open
Zdravko Iliev
requested to merge
1-document-sealing-implement-pdf-parser
into
master
3 years ago
Overview
0
Commits
26
Pipelines
24
Changes
10
Expand
Closes
#1
0
0
Merge request reports
Viewing commit
ddfd7daf
Prev
Next
Show latest version
10 files
+
70
−
12
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
ddfd7daf
add types for signatures and test for non pdf file
· ddfd7daf
Zdravko Iliev
authored
3 years ago
__tests__/index.test.ts
+
13
−
1
Options
@@ -11,8 +11,8 @@ describe("PDF parser", () => {
);
const
parser
=
new
PDFparser
(
file
);
const
actual
=
await
parser
.
getPDFMeta
();
expect
(
actual
.
pages
).
toEqual
(
2
);
});
@@ -35,4 +35,16 @@ describe("PDF parser", () => {
expect
(
error
).
toBeInstanceOf
(
AppError
);
}
});
it
(
"
should throw error if file type is different then pdf
"
,
async
()
=>
{
const
file
=
fs
.
readFileSync
(
path
.
resolve
(
__dirname
,
"
./test.txt
"
));
try
{
const
parser
=
new
PDFparser
(
file
);
const
actual
=
await
parser
.
getPDFMeta
();
}
catch
(
error
)
{
expect
(
error
).
toBeInstanceOf
(
AppError
);
expect
(
error
.
message
).
toEqual
(
"
Only pdf file type is supported
"
);
}
});
});
Loading