npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cypress-adc

v1.0.18

Published

Adcetera's extension of Cypress package for testing static sites

Downloads

6

Readme

cypress-adc

A starter kit for testing microsites and static projects. It uses Cypress.

Cypress is a tool for front end testing. It replicates user interaction. Anything that happens on the browser (HTML, CSS, Javascript) can be tested with Cypress.

Cypress provides a free, open source, locally installed Test Runner.

Check the repo here: github-repo

Check the npm here: cypress-adc

Getting Started

  • Install cypress-adc on the root directory with npm i cypress-adc

  • You will see these new folders and files appear:

  • When you are ready to test your code locally, go to cypress/integration/static.spec.js and write your tests there. You will see basic tests already written:
  1. Accessibility.

  2. Missing alt tags for images.

  3. Performance measure with Lighthouse.

  4. Proper metadata.

  • Cypress is a testing framework specialized in end to end testing. For this kind of testing, a local server is needed. You must serve your site/start your app FIRST and then begin testing. cypress-adc comes with a default server http-server.

  • To serve your site using http-server, run this command in your terminal npx http-server. Now you can visit http://localhost:8080 to view your site.

  • If you are using webpack, gulp, etc, to serve your site, simply update the port number on base url in cypress.json:

  • Open another terminal and run npx cypress open to open Cypress Test Runner.

  • When you are ready to commit and push changes to Github, our Github Action (which can be found on github/workflows/main.yml) will run Cypress tests on every push.

  • You can go to https://github.com/adcetera/<your-repo-name-here>/actions and see if all tests passed.

Things to know

  • If you want screenshot and videos of your tests, run npx http-server first and then run npx cypress run. Video and screenshots will appear in your cypress folder:
  • It is best practice to use one terminal for the local server and another terminal for cypress testing. If you try running server and cypress in one terminal, you may lose context of the server and will not be able to terminate it after testing is done.

  • Lighthouse automatically opens and closes another browser tab when running performance test.