Skip to content

Commit

Permalink
Updated the fixtures.
Browse files Browse the repository at this point in the history
Signed-off-by: Hermann Mayer <hermann.mayer92@gmail.com>
  • Loading branch information
Jack12816 committed Mar 11, 2024
1 parent ea51e94 commit 5fe81ff
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ XARGS ?= xargs
HTML_FILES := $(wildcard test/fixtures/*.html)
PDF_FILES := $(shell find test/fixtures/ -name '*.pdf')

FORCE_COLOR ?= true
export FORCE_COLOR

all:
# PDF Generator (pdfgen)
#
Expand Down Expand Up @@ -130,7 +133,7 @@ pdf-headers:
--header 'Authorization: Granted!' \
-a 'X-Test:true' \
--header 'custom: header' \
http://localhost:3000 \
http://localhost:3823 \
$(abspath test/fixtures/headers.pdf); \
$(KILL) %-;

Expand Down
2 changes: 1 addition & 1 deletion exe/test-server
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ http.createServer(function (req, res) {
}

res.end();
}).listen(3000);
}).listen(3823);
14 changes: 7 additions & 7 deletions test/bin/pdfgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ describe('pdfgen Binary', function() {
expect(existsSync(pdf)).to.be(true);
});

it('produces the expected PDF file (1% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(1);
it('produces the expected PDF file (5% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(5);
});
});
});
Expand Down Expand Up @@ -119,14 +119,14 @@ describe('pdfgen Binary', function() {
expect(existsSync(pdf)).to.be(true);
});

it('produces the expected PDF file (1% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(1);
it('produces the expected PDF file (5% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(5);
});
});
});

describe('file generation (headers)', () => {
let url = 'http://localhost:3000';
let url = 'http://localhost:3823';
let pdf = outputDest('headers');
let png = Suite.fixture('headers.png');

Expand All @@ -147,8 +147,8 @@ describe('pdfgen Binary', function() {
expect(existsSync(pdf)).to.be(true);
});

it('produces the expected PDF file (1% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(1);
it('produces the expected PDF file (5% tolerance)', () => {
expect(Suite.comparePdfWithPng(pdf, png)).to.be.lessThan(5);
});
});
});
2 changes: 1 addition & 1 deletion test/exe/test-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -eo pipefail

# Config
URL='http://localhost:3000'
URL='http://localhost:3823'

# Error handler
function on_error()
Expand Down
Binary file modified test/fixtures/broken.pdf
Binary file not shown.
Binary file modified test/fixtures/broken.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/complex.pdf
Binary file not shown.
Binary file modified test/fixtures/complex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/headers.pdf
Binary file not shown.
Binary file modified test/fixtures/headers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/multipage.pdf
Binary file not shown.
Binary file modified test/fixtures/multipage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/simple.pdf
Binary file not shown.
Binary file modified test/fixtures/simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/templates/circles.pdf
Binary file not shown.
Binary file modified test/fixtures/templates/circles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/websockets.pdf
Binary file not shown.
Binary file modified test/fixtures/websockets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5fe81ff

Please sign in to comment.