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

bug-district

v1.0.0

Published

`yarn add --dev bug-district`

Downloads

3

Readme

Install the library

yarn add --dev bug-district

Initialize your first action

  1. Install @testing-library/dom.
  2. Create a file named "bug-district.ts" in your code and add the following contents to it:
import { initializeTestActions, ActionRunner } from 'bug-district';
import { screen, waitFor } from '@testing-library/dom';

const actionRunners: ActionRunner[] = [
  {
    // An example of an action that checks if a text is on the screen.
    id: 'check-text-is-visible-on-screen',
    
    // A label to be shown in the test runner.
    label: 'Check that text is visible on screen',
    
    // Arguments that can be set in the test runner.
    arguments: [{ id: 'text' }],
    
    // The function that will run when the action is triggered.
    run: async (data) => {
        const { text } = data.args;
        await waitFor(
            async () => {
                const element = await screen.findByText(text);

                if (element == null) {
                    throw new Error(
                        'Could not find text "' + text + '" on the screen.'
                    );
                }
            },
        )
   },
];

// Initialize the actions that will run in your tests
initializeTestActions({ actions: actionRunners });
  1. Import bug-district.ts somewhere in your app:

import './bug-district'

  1. Run your localhost web server (e.g. yarn dev or yarn start).
  2. Login with your Github account on Bug District
  3. Go to the Github repo that you want to add tests to on Bug District, then select a branch (e.g. master)
  4. Add a test case on Bug District
  5. Add actions and run your test case!

NOTE: You must use Chrome to run the tests on Bug District. You will also need to enable "Insecure origins treated as secure". Navigate to chrome://flags/ to enable the option.

Run all tests

To run all of your tests, add the following script to your "package.json" file.

"run-ui-tests": "node ./node_modules/bug-district/dist/runTestSuite.js ./ui-tester-test-suite.json PORT"

Replace PORT with your localhost post where your website runs (e.g. 3000). If the parth the the node_modules or the test-suite needs to be changed, then make sure to change it in the script.

You can then run the script like this:

yarn run-ui-tests