Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cypress-teamcity-reporter

prma8594.1kMIT4.0.0

teamcity reporter for cypress

cypress, mocha, teamcity, reporter, jetbrains

readme

cypress-teamcity-reporter

NPM version Codacy Badge Build Status

cypress-teamcity-reporter is a Teamcity reporter which makes it possible to display test results in real-time, makes test information available on the Tests tab of the Build Results page. It is based on the package @cypress/mocha-teamcity-reporter and was improved with new informations and support to the newer versions of mocha.

Version changes

Check out the changelog

Requirements

  • NodeJs 6+
  • Web Browser supporting ES6

To Install

In your project run a npm install command:

npm install cypress-teamcity-reporter --save-dev

or

yarn add cypress-teamcity-reporter --dev

Usage

https://github.com/visionmedia/mocha/wiki/Third-party-reporters describes using third party reporters in mocha.

Then call mocha with:

mocha --reporter cypress-teamcity-reporter test

To use it in the TeamCity, you can call:

cypress run --reporter cypress-teamcity-reporter

Running In Browser

  • Use lib/teamcityBrowser
  • Has option parsing stripped out for the moment
  • Example use can be found in test\browser
  • Custom log function can be set with window.customLogFunction

Customization

TeamCity flowId

Can set flowId like: mocha test --reporter mocha-teamcity-reporter --reporter-options flowId=gobbledygook

Top-level suite name

Can set a top-level suite name, which will wrap all other suites.
This is useful for reading test output when running multiple suites in a single build

  • Environment variable: MOCHA_TEAMCITY_TOP_LEVEL_SUITE=<suiteName>
  • Reporter option: topLevelSuite=<suiteName>

log test failures with std error

To enable this please Please note this will probaly be made default in the next major version

  • Environment variable: USE_STD_ERROR=true
  • Reporter option: useStdError=true

Record hook failures

Record failures for hooks such as before/after etc Please note this will probably be made default in the next major version

  • Environment variable: RECORD_HOOK_FAILURES=true
  • Reporter option: recordHookFailures=true

Setting options

  • Set with reporter-options:

mocha test --reporter mocha-teamcity-reporter --reporter-options topLevelSuite=top-level-suite-name

mocha test --reporter mocha-teamcity-reporter --reporter-options useStdError=true

mocha test --reporter mocha-teamcity-reporter --reporter-options useStdError=true

  • Set with environment variable

MOCHA_TEAMCITY_TOP_LEVEL_SUITE='top-level-suite-name' mocha test --reporter mocha-teamcity-reporter

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[4.0.0] - 02/15/2023

Changed

  • Node.js 12 minimum support
  • Mocha 4 minimum support

Updated

  • All dependencies

[3.0.0] - 09/21/2020

Removed

  • Bower support
  • Node.js 4 support (now it requires minimum of node 6)

Changed

  • Breaking: focus on only support node.js environments
  • Breaking: Remove phantomJs support only supports environments which have require
  • Breaking: Using ESLint 7+ for development, what means to create a branch/PR you will need node 10+

Added

  • Azure Pipelines CI
  • Change mocha to peer dependency
  • Support mocha version 8
  • Drop the duration on messages if mocha returns undefined/null (for example skipped test) TeamCity will then use received timestamps to calculate duration
  • Support Show diff between expected and actual values

[2.6.1] - 02/21/2019

  • Changes to publish the NPM package

[2.6.0] - 02/20/2019

  • Minor changes
  • Forked travisjeffery/mocha-teamcity-reporter v2.5.0
    • Restrict mocha dependency to less than 6 due to compatibility issues
    • Vuejs/Webpack compatibility
    • Add Browser Support back in by use of separate file, solves #41
    • Add real teamcity tests
    • Add reporterOptions as optional parameter
    • Add a test to catch above PR
    • Supports node 4+ only
    • Support flowId's
      • Why use flowIds? Flow tracking is necessary, for example, to distinguish separate processes running in parallel
      • This defaults to process.pid, so it works with concurrent task runners (Gulp/Grunt etc)
    • Functional tests
    • Add top level suite option (@davidmfoley)
    • Add some eslint magic
    • Remove escape sequences from reporting
    • Fix NaN duration