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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@webship-js/astro-steps

v2.0.0

Published

webship-js test project for testing an Astro site's main pages.

Readme

Astro-steps

A webship-js test project for Astro sites: custom step definitions for a site's generator metadata, navigation menu, and link health, combined with webship-js's own built-in steps in BDD-style Cucumber .feature files.

Installation

To reuse these steps in your own webship-js project:

npm install --save-dev webship-js @webship-js/astro-steps

Add both step-definition paths to your project's cucumber.js:

module.exports = {
  default: {
    require: [
      'node_modules/webship-js/tests/step-definitions/**/*.js', // webship-js core steps
      'node_modules/@webship-js/astro-steps/tests/step-definitions/astro.steps.js', // this plugin
      'tests/step-definitions/**/*.js', // your own custom steps, if any
    ],
    paths: ['tests/features/**/*.feature'],
    worldParameters: {
      launchUrl: process.env.LAUNCH_URL || 'https://your-astro-site.example',
    },
  },
};

What's in this repo

| Path | What it is | | ------------------------------ | ----------------------------------------------------------------- | | tests/step-definitions/ | Custom Astro step definitions (astro.steps.js) | | tests/features/ | Feature files testing the demo site's main pages | | demo/ | A minimal Astro site used as the test fixture | | .github/workflows/ | CI: builds the demo site with DDEV and runs the test suite |

Quick start

npm install
npx playwright install chromium

cd demo && npm install && npm run dev   # serves http://localhost:4321
cd ..

LAUNCH_URL=http://localhost:4321 npm test

Set worldParameters.launchUrl in cucumber.js (or the LAUNCH_URL environment variable) to point the suite at any Astro site — the demo site or a real deployment.

Writing feature files

Combine webship-js's built-in steps with the custom Astro steps in tests/step-definitions/astro.steps.js:

Feature: Home page

  Scenario: Home page is generated by Astro and has working navigation
    Given I am on the homepage
    Then the page should be generated by Astro
    And I should see a navigation menu with the following links:
      | text  | path    |
      | Home  | /       |
      | About | /about  |
    And all navigation links should resolve successfully

The custom steps are:

| Step | Type | | --- | --- | | I should( not) see the Astro generator meta tag / the page should( not) be generated by Astro | Then | | the page should( not) be generated by Astro version "<prefix>" | Then | | the page title should( not) end with "<suffix>" | Then | | I should( not) see a navigation menu with the following links: (table with text and optional path) | Then | | all navigation links should resolve successfully | Then |

Every Then step takes should or should not, every pronoun step takes I, we or no pronoun, and every failure is a friendly message with a hint (no assertion stack). Each assertion polls its condition for the minWaitTime.page budget (at least 10 s) instead of reading the page once. The reference features assert the demo site's own titles, copy and paths ("Astro Steps Demo", /blog/hello-world/, ...); swap them for your site's content when you copy a feature.

See tests/features/README.md for the full list of feature files, and tests/step-definitions/astro.steps.js for the custom step definitions themselves (five Gherkin examples each). npm run test:examples checks that every example matches its own step (and no webship-js core step) and that every feature step is defined exactly once; CI runs it before the suite.

See CONTRIBUTING.md for git identity and branching rules.

License

MIT