
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Visual PDF comparison tool.
pdftest
to your project using npm install --save-dev pdftest
.pdftest serve
(optionally specifying a port and root folder, e.g. pdftest serve 3000 ./path/to/pdfs/
).pdftest
in your test files, making sure your tests are being run in a browser (e.g. via karma
).pdftest
to the server using pdftest.client.api.connect
(e.g. pdftest.client.api.connect('http://localhost:3000')
).pdftest.client.compare
and/or pdftest.client.compareToSnapshot
to compare PDFs.Note: When using the main browser dist (pdftest.client.min.js
), you will have access to only the client methods, which will be exposed directly on the pdftest
exposed variable.
E.g. in the browser, you should invoke pdftest.api.connect
and pdftest.compare
, rather than pdftest.client.api.connect
/ pdftest.client.compare
.
In most use cases you will need to start the pdftest
server before running your tests, and end it when the tests are finished. There are several patterns to accomplish this:
start-server-and-test
(recommended):
Install start-server-and-test
as a dev dependency (npm i -D start-server-and-test
), then use in your npm scripts:
"test:serve": "pdftest serve 3000",
"test:run": "karma start",
"test": "start-server-and-test test:serve http://localhost:3000 test:run",
pdftest start
and pdftest stop
:
This option is built-in and requires no extra dependencies - its main disadvantage is that it will not automatically stop the server if something goes wrong. Active processes are tracked in a data.json
file, which pdftest stop
references to kill the process. In rare cases this approach could result in "orphaned" background processes.
To use it in your npm scripts:
"test": pdftest start 3000 && karma start && pdftest stop 3000",
npm-run-all
and wait-on
:
Install npm-run-all
and wait-on
as dev dependencies (npm i -D npm-run-all wait-on
), then use in your npm scripts:
"test:serve": "pdftest serve 3000",
"test:run": "wait-on http://localhost:3000 && karma start",
"test": "npm-run-all --parallel --race test:serve test:run",
Using &
(not recommended):
&
to run the server and tests simultaneously, e.g. pdftest serve 3000 & karma start
For more info, see the discussion of options in the Cypress documentation.
npm run stage-release [major/minor/patch]
: Bumps the version and creates a release branch to prepare the new release.
npm run release [tagmessage]
: Builds the release, tags it, and merges it back into master.
npm publish
: Publishes the current version to npm.
Make sure to define .env
with environment variables used by @sortpark/build-tools
- see .env.sample
for example values.
FAQs
Client-side visual testing library for PDFs
The npm package pdftest receives a total of 355 weekly downloads. As such, pdftest popularity was classified as not popular.
We found that pdftest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.