-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e76f3df
commit 139b322
Showing
12 changed files
with
804 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM formio/pdf-libs:tmp | ||
|
||
WORKDIR /usr/src/pdf-libs | ||
# Remove test folder | ||
RUN rm -rf test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
const superagent = require('superagent'); | ||
const runServer = require('./runServer'); | ||
|
||
const PDF_FIXTURE = path.resolve(__dirname, './fixtures/fw4.pdf'); | ||
|
||
describe('Test convertToHtml', () => { | ||
let server; | ||
|
||
before(async () => { | ||
server = await runServer(3000); | ||
}); | ||
|
||
it('should return html', async () => { | ||
const response = await superagent | ||
.post(`http://localhost:3000/pdf/convertToHtml`) | ||
.set('Content-Type', 'multipart/form-data') | ||
.attach('pdf', PDF_FIXTURE); | ||
|
||
const html = response.text; | ||
assert.ok(html.includes('<!DOCTYPE html>')); | ||
assert.ok(html.includes('Base CSS for pdf2htmlEX')); | ||
}); | ||
|
||
after(() => { | ||
server.kill(); | ||
}); | ||
}); |
Oops, something went wrong.