@testream/mocha-reporter 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -7
- package/package.json +21 -10
package/README.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
# @testream/mocha-reporter
|
|
1
|
+
# @testream/mocha-reporter: Mocha test reporting for Jira
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@testream/mocha-reporter` publishes Node.js Mocha test results from CI/CD to Testream, where failures and run context become durable evidence visible from Jira. Mocha remains the code-first execution source, with no requirement to recreate every automated test as a manual Jira case.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What the reporter sends to Testream and Jira
|
|
6
|
+
|
|
7
|
+
- Passed, failed, skipped, and pending Mocha results
|
|
8
|
+
- Failure messages, stack traces, and runtime source snippets
|
|
9
|
+
- Branch, commit, build, environment, and CI metadata
|
|
10
|
+
- Suite changes and trends for Jira work and release reviews
|
|
11
|
+
|
|
12
|
+
This connects Node.js testing feedback to the product and delivery context teams already manage in Jira.
|
|
13
|
+
It is designed for existing Mocha projects rather than a replacement test runner.
|
|
14
|
+
|
|
15
|
+
## Install and configure
|
|
6
16
|
|
|
7
17
|
```bash
|
|
8
18
|
npm install --save-dev @testream/mocha-reporter
|
|
@@ -19,8 +29,24 @@ module.exports = {
|
|
|
19
29
|
};
|
|
20
30
|
```
|
|
21
31
|
|
|
22
|
-
The reporter
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
The reporter captures the Mocha test body’s source text at runtime, so generated CTRF reports include a bounded `snippet` even when explicit line metadata is unavailable.
|
|
33
|
+
|
|
34
|
+
## Mocha evidence in CI/CD
|
|
35
|
+
|
|
36
|
+
Keep running Mocha with the configuration above and store `TESTREAM_API_KEY` as a protected secret. The reporter publishes completed results from GitHub Actions, GitLab CI/CD, Azure Pipelines, Jenkins, or another command-based CI provider, preserving failure and build context for later inspection.
|
|
37
|
+
|
|
38
|
+
## Frequently asked questions
|
|
39
|
+
|
|
40
|
+
### Do we need to recreate automated tests as manual Jira cases?
|
|
41
|
+
|
|
42
|
+
No. Your Mocha suite remains the execution source. Testream publishes its evidence for Jira users without asking the team to maintain duplicate manual cases.
|
|
43
|
+
|
|
44
|
+
### Are source snippets available without line metadata?
|
|
45
|
+
|
|
46
|
+
Yes. The reporter captures bounded runtime source text from the Mocha test body, providing useful evidence when exact source-line metadata is unavailable.
|
|
47
|
+
|
|
48
|
+
## Official Testream resources
|
|
25
49
|
|
|
26
|
-
|
|
50
|
+
- [Mocha Jira integration](https://testream.app/mocha-jira-integration)
|
|
51
|
+
- [Complete Mocha reporter setup guide](https://docs.testream.app/reporters/mocha)
|
|
52
|
+
- [Install Testream – Automated Test Management for Jira](https://marketplace.atlassian.com/3048460704)
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testream/mocha-reporter",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Mocha
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "Publish Mocha test results, failures, source snippets, and CI metadata to Testream and Jira.",
|
|
5
|
+
"homepage": "https://testream.app/mocha-jira-integration",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"scripts": {
|
|
@@ -20,14 +21,18 @@
|
|
|
20
21
|
"url": "git+https://github.com/testream/docs.git"
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
24
|
+
"testream",
|
|
23
25
|
"mocha",
|
|
24
|
-
"reporter",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"test-results",
|
|
26
|
+
"mocha-reporter",
|
|
27
|
+
"mocha-jira",
|
|
28
|
+
"nodejs",
|
|
28
29
|
"jira",
|
|
30
|
+
"test-management",
|
|
31
|
+
"automated-test-management",
|
|
32
|
+
"test-reporting",
|
|
33
|
+
"ci-cd",
|
|
29
34
|
"ctrf",
|
|
30
|
-
"
|
|
35
|
+
"unit-testing"
|
|
31
36
|
],
|
|
32
37
|
"author": "Testream",
|
|
33
38
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -37,20 +42,26 @@
|
|
|
37
42
|
"dependencies": {
|
|
38
43
|
"mocha-ctrf-json-reporter": "^0.0.10"
|
|
39
44
|
},
|
|
45
|
+
"overrides": {
|
|
46
|
+
"js-yaml": "^4.2.0",
|
|
47
|
+
"mocha": {
|
|
48
|
+
"diff": "^8.0.4"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
40
51
|
"peerDependencies": {
|
|
41
52
|
"mocha": ">=8.0.0"
|
|
42
53
|
},
|
|
43
54
|
"devDependencies": {
|
|
44
55
|
"@jira-test-manager/shared-types": "*",
|
|
45
56
|
"@types/mocha": "^10.0.0",
|
|
46
|
-
"@types/node": "^
|
|
57
|
+
"@types/node": "^25.9.3",
|
|
47
58
|
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
48
59
|
"@typescript-eslint/parser": "^6.17.0",
|
|
49
60
|
"@vercel/ncc": "^0.38.1",
|
|
50
61
|
"eslint": "^8.56.0",
|
|
51
62
|
"prettier": "^3.1.1",
|
|
52
|
-
"typescript": "^
|
|
53
|
-
"vitest": "^
|
|
63
|
+
"typescript": "^6.0.3",
|
|
64
|
+
"vitest": "^4.1.9"
|
|
54
65
|
},
|
|
55
66
|
"engines": {
|
|
56
67
|
"node": ">=18.0.0"
|