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

nightwatchjs-teams-reporter

v0.1.2

Published

A package to help you surface the results of your NightwatchJS runs onto Microsoft Teams.

Downloads

5

Readme

NightwatchJS Teams Reporter

This tool is a work in progress.

By default a card will only be sent to teams if there is an error, this behaviour can be overridden with options described below.

Installation and Setup:

npm i nightwatchjs-teams-reporter --save

Next you need to setup the URL for your webhook. You can look up how to get the incoming webhook for teams here.

You will also either need to set the URL that you got above so that NightwatchJS Teams Reporter can use it. In CI you can set it as an environment variable in your tool of choice. Locally you can use a .env file or set the environment variable locally in your terminal. You can also set it as an option when calling the NightwatchJS Teams Reporter using the options defined further down the readme (recommended for testing only).

I like using a .env file.

.env

Create a .env file in the root of your project and populate it with something that looks like this.

Note you need to replace everything after the equals sign (=) with your inbound teams webhook URL.

INBOUND_TEAMS_WEBHOOK=<Replace this with your Teams WebhookURL e.g. https://place.webhook.office.com/webhook/abigoldhash>

Usage

Here are some examples of usage below as they would appear in your projects package.json file under scripts:

	"scripts": {
		"test": "nightwatch",
		"test:reporter": "nightwatch --reporter=nightwatchjs-teams-reporter",
		"test:reporter:projectName": "npm run test:reporter --testProjectName='Non-default Test ProjectName'",
		"test:reporter:send": "npm run test:reporter --sendOnSuccess"
	},

This is an example from Windows. I found concatinating together different options tricky and the internet seems to think this is a Windows consideration. So above you can see I reuse test:reporter in other scripts rather than chaining together options.

Options:

  • --sendOnSuccess override default behaviour and send a card to Teams regardless of whether there has been a failure or not.
  • --testProjectName give your test project a name. Usage: `--testProjectName='The Name of my Project'.
  • --testWebhookURL define your teams webhook URL, this is here for testing, I recommend you use an environment variable in your build pipeline to keep this URL obscured.

Thanks