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

mock-event-hub

v0.1.0

Published

This package exposes a mock Event Hubs service for use in testing.

Downloads

41

Readme

Mock Event Hubs service - This is a fork of a non published @azure/mock-hub

This package exposes a mock Event Hubs service for use in testing.

Currently the mock service represents a single Event Hub within a namespace.

Goals

This project was spun up for the following reasons:

  1. Avoid hitting the live service for tests.
  2. Deterministically trigger 'bad' service behavior.
  3. Simplify tests that rely on state. (populate events, change consumer groups/partition ids)
  4. Extend to support record & playback.

Currently, the project only fulfills the 1st goal. It is possible to start this service locally either in a separate process or in the same process as the event-hubs tests and run the live tests against the local service instead.

How to use the service in Event Hubs live tests

First, the mock-hub needs to be configured with a cert to support TLS.

Next, the event-hubs unit-test scripts can be updated to start the mock event hubs service and run the live tests against the service using the NODE_EXTRA_CA_CERTS environment variable pointing to the CA that mock-hub's cert was signed with.

Next steps

Here's a list of some features that would be helpful for the event-hubs live tests:

  • Support multiple Event Hubs. This would allow us to create a new Event Hub for each test and let us run all our tests in parallel.

  • Expose listeners on mock service. This could be useful so we don't need to perform as many steps as we do today for tests. For instance, instead of sending events then creating a consumer to make sure those events were sent, we could listen on the mock service so it can tell us if the messages were received.

  • Expose APIs to trigger errors. For example, it would be useful to be able to tell the service to do something like 'send 5 messages then throw an error'.

Additional details

Some details on what features the mock service supports can be found here.

Some details on the overal architecture of this project can be found here.

To see a quick example of how to start the mock service, look at here.