Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pagedjs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
144
Issues
144
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tools
pagedjs
Commits
1314fbc6
Commit
1314fbc6
authored
May 08, 2018
by
Fred Chasen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update readme
parent
c644eeae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
README.md
README.md
+21
-4
package.json
package.json
+2
-1
No files found.
README.md
View file @
1314fbc6
...
@@ -60,9 +60,26 @@ Build the `dist` output
...
@@ -60,9 +60,26 @@ Build the `dist` output
```
sh
```
sh
$
npm run prepare
$
npm run prepare
```
```
## Testing
## Testing
To test the pdf output, you'll need to install ghostscript locally.
Testing for Paged.js uses
[
Jest
](
https://facebook.github.io/jest/en/
)
but is split into Tests and Specs.
### Tests
Unit tests for Chunker and Polisher methods are run in node using JSDOM.
```
bash
npm run tests
```
### Specs
Specs run a html file in Chrome (using puppeteer) to test against CSS specifications.
They can also output a pdf and compare pages (one at a time) in that PDF with samples PDFs (saved as images).
To test the pdf output of specs, you'll need to install ghostscript locally.
```
bash
```
bash
brew
install
ghostscript
brew
install
ghostscript
...
@@ -71,17 +88,17 @@ brew install ghostscript
...
@@ -71,17 +88,17 @@ brew install ghostscript
Then run the jest tests in puppeteer.
Then run the jest tests in puppeteer.
```
bash
```
bash
npm
test
npm
run specs
```
```
To debug the results of a test in a browser you can add
`NODE_ENV=debug`
To debug the results of a test in a browser you can add
`NODE_ENV=debug`
```
bash
```
bash
NODE_ENV
=
debug npm
test
NODE_ENV
=
debug npm
run specs
```
```
To update the stored pdf images you can run
To update the stored pdf images you can run
```
bash
```
bash
npm
test
--
-u
npm
run specs
--
--updateSnapshot
```
```
package.json
View file @
1314fbc6
...
@@ -36,7 +36,8 @@
...
@@ -36,7 +36,8 @@
"scripts"
:
{
"scripts"
:
{
"build"
:
"./node_modules/.bin/rollup -c"
,
"build"
:
"./node_modules/.bin/rollup -c"
,
"start"
:
"./node_modules/.bin/rollup -w -c rollup.server.config.js"
,
"start"
:
"./node_modules/.bin/rollup -w -c rollup.server.config.js"
,
"test"
:
"jest --config=tests/jest.config.js"
,
"test"
:
"npm run tests && npm run specs"
,
"tests"
:
"jest --config=tests/jest.config.js"
,
"specs"
:
"jest --config=specs/jest.config.js"
,
"specs"
:
"jest --config=specs/jest.config.js"
,
"compile"
:
"./node_modules/.bin/babel src/ -d lib/"
,
"compile"
:
"./node_modules/.bin/babel src/ -d lib/"
,
"pretest"
:
"npm run build"
,
"pretest"
:
"npm run build"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment