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

site-smoke-test

v1.0.0-beta.1

Published

Site Smoke Test is a CLI tool which looks at a website sitemap, and uses Playwright to ensure that no errors are thrown on each of the pages.

Downloads

5

Readme

Site Smoke Test

Site Smoke Test is a CLI tool which looks at a website sitemap, and uses Playwright to ensure that no errors are thrown on each of the pages.

Installation

To use, install the NPM package globally:

npm install -g site-smoke-test

Then, once installed - run site-smoke-test to see all available options.

Basic Usage

To use the tool, pass through the URL to your website. You can also pass through a direct URL to your sitemap.xml file.

site-smoke-test https://your-website.com

Alternatively, you can use the --urls flag to define a series of URLs.

site-smoke-test --urls https://example.com https://example.com/test

Advanced Usage

Reporting

You can customise how the reports are generated by passing through the names of each report using the --reporters flag:

site-smoke-test https://your-website.com/sitemap.xml --reporters console junit

Configuration File

You can use a configuration file named site-smoke-test.config.(json|yml|js) to include configuration for the tool.

{
  "sitemapURL": "https://your-website.com/sitemap.xml",
  "reporters": ["console", "junit"]
}

Configuration Hooks

These hooks are called at specific times while the tool is running. In order for you to use them, you need to use a site-smoke-test.config.js file.

module.exports = {
  sitemapURL: 'https://your-website.com/sitemap.xml',

  beforeAll: (tests) => {
    // Before all of the tests are ran, log out the test object
    console.log(tests);
  }
}
beforeAll(tests: Tests[])

The beforeAll hook is called before all of the tests are ran.

afterAll(tests: Tests[])

The afterAll hook is called after all of the tests are ran.

beforePage(test: Test)

The beforePage hook is called before a test is ran.

afterPage(test: Test)

The afterPage hook is called after a test is ran.

You can also do things like modify the result of the test if required.

module.exports = {
  // ...
  afterPage: (test) => {
    // Here you might want to add some logic that would make the test pass or fail, such as if the test is on a specific path.

    // Force all of the tests to pass
    test.pass();

    // Alternatively - you can force all of the tests to fail.
    test.fail();
  }
}

Development

Todo

There are a few things I'd like to do before I fully release the project - these include:

  • [x] - Additional Reporters
  • [x] - Playwright customisation
  • [ ] - Plugin/Extension support
  • [x] - Add unit tests for the tool