itereshchenkov / jest-teamcity Goto Github PK
View Code? Open in Web Editor NEWJest Teamcity Reporter
License: MIT License
Jest Teamcity Reporter
License: MIT License
It would be nice to output coverage data to team city as well.
Environment: Windows 10
jest-teamcity version: 1.9.0
TeamCity version: TeamCity Professional 2020.2.4 (build 86063)
Issue:
I installed the npm package, added this to my package.json
:
"jest": {
"reporters": ["default", "jest-teamcity"]
}
and I use the npm test
command defined as "test": "jest"
in package.json
to run my tests. The result on TeamCity server is standard text output, the same like without the plugin. The tests are also not included in TeamCity's tests results.
I also tried to set the environment variable in Windows TEAMCITY_VERSION
(both as system variable and user variable), but when I execute npm test
locally with this variable defined the output is still standard, not the TeamCity one.
Solution:
I found out that adding this configuration to package.json
doesn't work anymore. It only worked for me when I added the configuration to jest
's configuration file.
I issued a PR with the documentation update: #20
Hi,
We switched to this library from jest-teamcity-reporter
, and noticed that general test suite failures are not being reported.
The other library indeed reports them as a "fake" test: https://github.com/winterbe/jest-teamcity-reporter/blob/2ebc892673611123abe34328a97a37900e277092/index.js#L25
I believe something similar should be done here.
I won't have time this week to submit a PR, so I'm opening this issue in case someone else wants to take it.
Thanks!
I work on an Angular app and just recently converted it from jasmine + karma to Jest. I added this package to help report the test to our TeamCity server and it is working great!
However, we are in a mono repo with multiple different projects, some in TS/JS, some in C#, so we would like to be able to separate these tests from tests of other projects - currently, our TeamCity looks something like this:
Name | Other info... |
---|---|
WebApi Tests | ... |
Playwright Tests | ... |
<38 suites for UI tests...> | ... |
If possible, we would love an option that would turn this into:
Name | Other info... |
---|---|
WebApi Tests | ... |
Playwright Tests | ... |
UI Tests | ... |
Where the UI Tests would contain the 38 suites.
I would go for path-based sorting as explained below, but any solution that would allow me to group the tests is what I am asking for.
Path-based sorting
Suite: name given in config
Namespace/package: path[0..-1].Join('.')
Class: path[-1]
Test: as is
Hello, I am getting below error on running our Jest Unit tests for our vue js app via teamcity.
Trace: The node type SpreadProperty has been renamed to SpreadElement
at Object.isSpreadProperty (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\types\lib\validators\generated\index.js:4304:11)
at hasSpread (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\babel-plugin-transform-object-rest-spread\lib\index.js:38:13)
at PluginPass.ObjectExpression (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\babel-plugin-transform-object-rest-spread\lib\index.js:234:14)
at newFn (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\visitors.js:193:21)
at NodePath._call (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\path\context.js:53:20)
at NodePath.call (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\path\context.js:40:17)
at NodePath.visit (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\path\context.js:88:12)
at TraversalContext.visitQueue (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\context.js:118:16)
at TraversalContext.visitSingle (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\context.js:90:19)
at TraversalContext.visit (D:\BuildAgent\work\87cb20bee7187581\SMA Web\SMA.Web\node_modules\@babel\core\node_modules\@babel\traverse\lib\context.js:146:19)
Also If I run it from cmd from the build agent directly, I can see tests running though,
Can you help me what could be the issue ?
When having a describe block with the name "constructor", the above error appears.
This is due to how we collect suites:
jest-teamcity/lib/formatter.js
Line 110 in f1c956b
I'm guessing it's trying to set the object constructor, when path
includes the word "constructor", instead of adding a new key with the name "constructor".
I get the following error when using this:
[15:10:55][Step 1/1] $ jest --config=src/react/jest.config.json --verbose --teamcity
[15:10:56][Step 1/1] C:\BuildAgent\work\e49c7465ca0ba2a8\KvK.Internet.Web\node_modules\jest-util\build\validateCLIOptions.js:63
[15:10:56][Step 1/1] throw createCLIValidationError(unrecognizedOptions, allowedOptions);
[15:10:56][Step 1/1] ^
[15:10:56][Step 1/1]
[15:10:56][Step 1/1] â—� Unrecognized CLI Parameter:
[15:10:56][Step 1/1]
[15:10:56][Step 1/1] Unrecognized option "teamcity".
[15:10:56][Step 1/1]
[15:10:56][Step 1/1] CLI Options Documentation:
[15:10:56][Step 1/1] http://facebook.github.io/jest/docs/cli.html
[15:10:56][Step 1/1]
[15:10:56][Step 1/1] error Command failed with exit code 1.
Hi,
TeamCity allows me to download the jest-teamcity test results (test duration, etc) as a CSV file. Is there a way to access this information in a build step, or at least convert it to an artifact?
I'd like to automatically collect results across builds and make some comparisons.
Thank you...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.