@reporters/github 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.1](https://github.com/MoLow/reporters/compare/github-v1.4.0...github-v1.4.1) (2023-07-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * more accurate counting ([1949140](https://github.com/MoLow/reporters/commit/19491406b769f03555b3ae352ed9838e2154c855))
9
+
3
10
  ## [1.4.0](https://github.com/MoLow/reporters/compare/github-v1.3.0...github-v1.4.0) (2023-07-18)
4
11
 
5
12
 
package/index.js CHANGED
@@ -75,7 +75,6 @@ module.exports = async function githubReporter(source) {
75
75
  break;
76
76
  }
77
77
  }
78
- core.startGroup(`Test results (${counter.pass} passed, ${counter.fail} failed)`);
79
78
  const formatedDiagnostics = diagnostics.map((d) => {
80
79
  const [key, ...rest] = d.split(' ');
81
80
  const value = rest.join(' ');
@@ -84,6 +83,7 @@ module.exports = async function githubReporter(source) {
84
83
  DIAGNOSTIC_VALUES[key] ? DIAGNOSTIC_VALUES[key](value) : value,
85
84
  ];
86
85
  });
86
+ core.startGroup(`Test results (${formatedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.pass)?.[1] ?? counter.pass} passed, ${formatedDiagnostics.find(([key]) => key === DIAGNOSTIC_KEYS.fail)?.[1] ?? counter.fail} failed)`);
87
87
  core.notice(formatedDiagnostics.map((d) => d.join(': ')).join(EOL));
88
88
  core.endGroup();
89
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reporters/github",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A github actions reporter for `node:test`",
5
5
  "keywords": [
6
6
  "github actions",
@@ -6,8 +6,7 @@ const assert = require('assert');
6
6
  const path = require('path');
7
7
  const { readFileSync, writeFileSync } = require('fs');
8
8
  const { compareLines } = require('../../../tests/utils');
9
- // eslint-disable-next-line import/no-dynamic-require
10
- const output = require(`./output.${process.version.split('.')[0]}`);
9
+ const output = require('./output');
11
10
 
12
11
  const GITHUB_STEP_SUMMARY = join(tmpdir(), 'github-actions-test-reporter');
13
12
  writeFileSync(GITHUB_STEP_SUMMARY, '');
@@ -16,7 +16,7 @@ module.exports = {
16
16
  ::debug::completed running is skipped
17
17
  ::debug::starting to run is a todo
18
18
  ::debug::completed running is a todo
19
- ::group::Test results \\(6 passed, 2 failed\\)
19
+ ::group::Test results \\(3 passed, 1 failed\\)
20
20
  ::notice::Total Tests: 6%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: .*ms
21
21
  ::endgroup::
22
22
  `,
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- stdout: `::debug::starting to run tests
3
- ::debug::starting to run is ok
4
- ::debug::completed running is ok
5
- ::debug::starting to run fails
6
- ::error title=fails,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: this is an error\\] {%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at .*.<anonymous> (.*/example.js:6:11).*
7
- ::debug::starting to run is a diagnostic
8
- ::debug::completed running is a diagnostic
9
- ::notice file=tests/example.js::this is a diagnostic
10
- ::error title=tests,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: 1 subtest failed\\] { failureType: 'subtestsFailed', cause: '1 subtest failed', code: 'ERR_TEST_FAILURE' }
11
- ::debug::starting to run more tests
12
- ::debug::starting to run is ok
13
- ::debug::completed running is ok
14
- ::debug::completed running more tests
15
- ::debug::starting to run is skipped
16
- ::debug::completed running is skipped
17
- ::debug::starting to run is a todo
18
- ::debug::completed running is a todo
19
- ::group::Test results \\(6 passed, 2 failed\\)
20
- ::notice::Total Tests: 6%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: .*ms
21
- ::endgroup::
22
- `,
23
- summary: `<h1>Test Results</h1>
24
- <table><tr><td>Total Tests</td><td>6</td></tr><tr><td>Suites 📂</td><td>2</td></tr><tr><td>Passed ✅</td><td>3</td></tr><tr><td>Failed ❌</td><td>1</td></tr><tr><td>Canceled 🚫</td><td>0</td></tr><tr><td>Skipped ⏭️</td><td>1</td></tr><tr><td>Todo 📝</td><td>1</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table>
25
- `,
26
- };
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- stdout: `::debug::starting to run tests
3
- ::debug::starting to run is ok
4
- ::debug::completed running is ok
5
- ::debug::starting to run fails
6
- ::error title=fails,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: this is an error\\] {%0A failureType: 'testCodeFailure',%0A cause: Error: this is an error%0A at .*.<anonymous> (.*/example.js:6:11).*
7
- ::debug::starting to run is a diagnostic
8
- ::debug::completed running is a diagnostic
9
- ::notice file=tests/example.js::this is a diagnostic
10
- ::error title=tests,file=tests/example.js::\\[Error \\[ERR_TEST_FAILURE\\]: 1 subtest failed\\] { failureType: 'subtestsFailed', cause: '1 subtest failed', code: 'ERR_TEST_FAILURE' }
11
- ::debug::starting to run more tests
12
- ::debug::starting to run is ok
13
- ::debug::completed running is ok
14
- ::debug::completed running more tests
15
- ::debug::starting to run is skipped
16
- ::debug::completed running is skipped
17
- ::debug::starting to run is a todo
18
- ::debug::completed running is a todo
19
- ::group::Test results \\(6 passed, 2 failed\\)
20
- ::notice::Total Tests: 6%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 1%0ATodo 📝: 1%0ADuration 🕐: .*ms
21
- ::endgroup::
22
- `,
23
- summary: `<h1>Test Results</h1>
24
- <table><tr><td>Total Tests</td><td>6</td></tr><tr><td>Suites 📂</td><td>2</td></tr><tr><td>Passed ✅</td><td>3</td></tr><tr><td>Failed ❌</td><td>1</td></tr><tr><td>Canceled 🚫</td><td>0</td></tr><tr><td>Skipped ⏭️</td><td>1</td></tr><tr><td>Todo 📝</td><td>1</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table>
25
- `,
26
- };