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

web-optional-dots-reporter

v1.1.0

Published

A test reporter compatible with @web/test-runner, which can print either dots or test suites and test names ans which supports test coverage.

Downloads

7

Readme

web-optional-dots-reporter

Latest version Dependency status

A test reporter compatible with @web/test-runner, which can print either dots or test suites and test names ans which supports test coverage.

Installation

Using npm:

npm i -D web-optional-dots-reporter

Usage

Create a configuration file web-test-runner.config, import the reporter and create it:

import { optionalDotsReporter } from 'web-optional-dots-reporter';

export default {
  reporters: [
    optionalDotsReporter()
  ]
}

The exported function creates a new test reporter compatible with @web/test-runner:

function optionalDotsReporter(options?): Reporter

Options

The function optionalDotsReporter expects optionally an object with the following properties:

dots

Type: boolean Default: process.stdout.isTTY

If dots should be printed instead ot names of test suites and tests.

fileNames

Type: boolean Default: false

If the test file names should be printed alongside the test suite names.

reportResults

Type: boolean Default: true

If each test result should be printed before the test summary.

Examples

Successful test run, dots enabled:

> web-test-runner

...........................................................

Chrome: 47 files, 236 suites, 574 tests, 566 passed, 0 failed, 8 skipped in 4.5s

Failing test run, dots and browser log enabled:

> web-test-runner

....................x.....................................

🚧 Browser logs on Chrome:
      Lit is in dev mode. Not recommended for production!
      See https://lit.dev/msg/dev-mode for more information.

🚧 404 network requests on Chrome:
    - testNotExistingImg.svg

❌ HolyGrailElement > offers slots
      AssertionError: unexpected slot "nav-bottom": expected false to be true
      + expected - actual

      -false
      +true

      at o.<anonymous> (src/components/holy-grail/holy-grail.test.js:24:78)

Chrome: 47 files, 236 suites, 574 tests, 565 passed, 1 failed, 8 skipped in 5.0s

Failing test run, dots disabled:

> web-test-runner

HolyGrailElement
  𐄂 offers slots
  ✓ exposes parts (slot parents)
  ✓ hides side parts if their slots are empty
  ✓ shows side parts if their slots are not empty

❌ HolyGrailElement > offers slots
      AssertionError: unexpected slot "nav-bottom": expected false to be true
      + expected - actual

      -false
      +true

      at o.<anonymous> (src/components/holy-grail/holy-grail.test.js:24:78)

Chrome: 47 files, 236 suites, 574 tests, 566 passed, 0 failed, 8 skipped in 5.6s

Failing test run (insufficient coverage only), dots disabled:

> web-test-runner

HolyGrailElement
  ✓ offers slots
  ✓ exposes parts (slot parents)
  ✓ hides side parts if their slots are empty
  ✓ shows side parts if their slots are not empty

Coverage for statements (82.64'%) meets global threshold (70%)
Coverage for branches (79.92'%) meets global threshold (70%)
Coverage for functions (64.66'%) does not meet global threshold (70%)
Coverage for lines (82.64'%) meets global threshold (70%)

Chrome: 47 files, 236 suites, 574 tests, 566 passed, 0 failed, 8 skipped in 5.4s

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.

License

Copyright (C) 2023 Ferdinand Prantl

Licensed under the MIT License.