@reporters/github 1.2.0 → 1.4.0

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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0](https://github.com/MoLow/reporters/compare/github-v1.3.0...github-v1.4.0) (2023-07-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * support node 18 ([02c8957](https://github.com/MoLow/reporters/commit/02c8957ffca3cb8376f7ad5a94f4627c70b7f8e5))
9
+
10
+ ## [1.3.0](https://github.com/MoLow/reporters/compare/github-v1.2.0...github-v1.3.0) (2023-07-05)
11
+
12
+
13
+ ### Features
14
+
15
+ * publish with provenance ([6ee1e46](https://github.com/MoLow/reporters/commit/6ee1e46040329edeb0f40f753093b6952984f001))
16
+
3
17
  ## [1.2.0](https://github.com/MoLow/reporters/compare/github-v1.1.3...github-v1.2.0) (2023-05-30)
4
18
 
5
19
 
package/README.md CHANGED
@@ -33,4 +33,3 @@ additionally, this reporter will add a summary of the tests to the github action
33
33
 
34
34
  <img width="815" alt="Screen Shot 2022-12-20 at 3 43 47" src="https://user-images.githubusercontent.com/8221854/208561887-c3eccbd8-7506-4a8f-a18c-2892605f3243.png">
35
35
 
36
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reporters/github",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "A github actions reporter for `node:test`",
5
5
  "keywords": [
6
6
  "github actions",
@@ -1,3 +1,4 @@
1
+ const { test, describe } = require('node:test');
1
2
  const { spawnSync } = require('child_process');
2
3
  const { tmpdir } = require('os');
3
4
  const { join } = require('path');
@@ -11,14 +12,20 @@ const output = require(`./output.${process.version.split('.')[0]}`);
11
12
  const GITHUB_STEP_SUMMARY = join(tmpdir(), 'github-actions-test-reporter');
12
13
  writeFileSync(GITHUB_STEP_SUMMARY, '');
13
14
 
14
- const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], {
15
- env: { GITHUB_ACTIONS: true, GITHUB_STEP_SUMMARY, GITHUB_WORKSPACE: path.resolve(__dirname, '../../../') },
16
- });
15
+ describe('github reporter', () => {
16
+ const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], {
17
+ env: { GITHUB_ACTIONS: true, GITHUB_STEP_SUMMARY, GITHUB_WORKSPACE: path.resolve(__dirname, '../../../') },
18
+ });
17
19
 
18
- assert.strictEqual(child.stderr?.toString(), '');
19
- compareLines(child.stdout?.toString(), output.stdout);
20
- compareLines(readFileSync(GITHUB_STEP_SUMMARY).toString(), output.summary);
20
+ test('spwan with reporter', () => {
21
+ assert.strictEqual(child.stderr?.toString(), '');
22
+ compareLines(child.stdout?.toString(), output.stdout);
23
+ compareLines(readFileSync(GITHUB_STEP_SUMMARY).toString(), output.summary);
24
+ });
21
25
 
22
- const silentChild = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], { env: { } });
23
- assert.strictEqual(silentChild.stderr?.toString(), '');
24
- assert.strictEqual(silentChild.stdout?.toString(), '');
26
+ test('should noop if not in github actions', () => {
27
+ const silentChild = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example'], { env: { } });
28
+ assert.strictEqual(silentChild.stderr?.toString(), '');
29
+ assert.strictEqual(silentChild.stdout?.toString(), '');
30
+ });
31
+ });
@@ -12,11 +12,15 @@ module.exports = {
12
12
  ::debug::starting to run is ok
13
13
  ::debug::completed running is ok
14
14
  ::debug::completed running more tests
15
- ::group::Test results \\(4 passed, 2 failed\\)
16
- ::notice::Total Tests: 2%0APassed ✅: 1%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: .*ms
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
17
21
  ::endgroup::
18
22
  `,
19
23
  summary: `<h1>Test Results</h1>
20
- <table><tr><td>Total Tests</td><td>2</td></tr><tr><td>Passed ✅</td><td>1</td></tr><tr><td>Failed ❌</td><td>1</td></tr><tr><td>Canceled 🚫</td><td>0</td></tr><tr><td>Skipped ⏭️</td><td>0</td></tr><tr><td>Todo 📝</td><td>0</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table>
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>
21
25
  `,
22
26
  };
@@ -12,11 +12,15 @@ module.exports = {
12
12
  ::debug::starting to run is ok
13
13
  ::debug::completed running is ok
14
14
  ::debug::completed running more tests
15
- ::group::Test results \\(4 passed, 2 failed\\)
16
- ::notice::Total Tests: 4%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: .*ms
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
17
21
  ::endgroup::
18
22
  `,
19
23
  summary: `<h1>Test Results</h1>
20
- <table><tr><td>Total Tests</td><td>4</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>0</td></tr><tr><td>Todo 📝</td><td>0</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table>
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>
21
25
  `,
22
26
  };
@@ -12,11 +12,15 @@ module.exports = {
12
12
  ::debug::starting to run is ok
13
13
  ::debug::completed running is ok
14
14
  ::debug::completed running more tests
15
- ::group::Test results \\(4 passed, 2 failed\\)
16
- ::notice::Total Tests: 4%0ASuites 📂: 2%0APassed ✅: 3%0AFailed ❌: 1%0ACanceled 🚫: 0%0ASkipped ⏭️: 0%0ATodo 📝: 0%0ADuration 🕐: .*ms
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
17
21
  ::endgroup::
18
22
  `,
19
23
  summary: `<h1>Test Results</h1>
20
- <table><tr><td>Total Tests</td><td>4</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>0</td></tr><tr><td>Todo 📝</td><td>0</td></tr><tr><td>Duration 🕐</td><td>.*ms</td></tr></table>
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>
21
25
  `,
22
26
  };