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

@pandell/jest-teamcity

v0.4.2

Published

Modern Jest Test Result Processor for TeamCity

Downloads

82

Readme

jest-teamcity

License: MIT Node.js CI npm

jest-teamcity is a modern Jest Test Result Processor for TeamCity written in TypeScript. It makes use of TeamCity service messages to pass information about the Jest test results to the TeamCity server. This makes it possible to display Jest test results in real-time and make the test information available on the Tests tab of the Build Results page.

How To Use

To use @pandell/jest-teamcity, add the package to your project and update your Jest configuration:

yarn add -D @pandell/jest-teamcity

Add a reporter to the Jest configuration file or the package.json. For details, check the Jest documentation.

// `jest.config.js`
module.export = {
    ...
    reporters: process.env.TEAMCITY_VERSION ? ["@pandell/jest-teamcity"] : ["default"],
    ...
}

The above configuration uses the custom @pandell/jest-teamcity report if the TEAMCITY_VERSION environment variable is set (as is always the case for a TeamCity agent), and uses the default reporter otherwise, resulting in a nice local development experience.

Jest terminology

  • Test: A "single" test, declared with (it/test)
  • Test Suite: A collection of individual tests (grouped with describe)
  • Test Run: A single "run" of all test suites (as specified by the CLI, config, ...)

Custom Jest reporters

@pandell/jest-teamcity is implemented as a custom Jest reporter.

A custom reporter is a class that implements onRunStart, onTestStart, onTestResult, onRunComplete methods that will be called when any of those events occurs.

See the Jest documentation for more details.

When using @pandell/jest-teamcity, we recommend replacing the default reporter so that only TeamCity service messages are written to the standard output. The default Jest reporter is overridden automatically if only specifying @pandell/jest-teamcity as a custom reporter (see #how-to-use).

Jest Test Result Processors

Jest also has the notion of test result processors. However, @pandell/jest-teamcity is deliberately implemented as a custom Jest reporter to report on the test progress live, as a reporter can receive test results after individual tests and/or test suites are finished.

Contribute

To build and contribute to this project, you require Node and the yarn package manager.

yarn

# run tests
yarn test

Create a Release

To create a new release, you need to do the following steps:

# bump package version (you can also omit the arguments and follow the interactive prompt)
git checkout main
yarn version 1.2.3

# commit and add tag
git commit --message "v1.2.3"
git tag --annotate v1.2.3 --message "1.2.3"

# push tag to remote
git push origin v1.2.3

# create a new release (using GitHub CLI)
gh release create v1.2.3

The new release triggers a new package to be pushed to NPM registry via GitHub Actions.

Alternatives