@reporters/silent 1.0.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 ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (2022-12-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * add silent reporter ([#27](https://github.com/MoLow/reporters/issues/27)) ([d200b78](https://github.com/MoLow/reporters/commit/d200b7878384a2b8c930789418286d884eb49292))
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ [![npm version](https://img.shields.io/npm/v/@reporters/github)](https://www.npmjs.com/package/@reporters/github) ![tests](https://github.com/MoLow/reporters/actions/workflows/test.yaml/badge.svg?branch=main)
2
+ # Silent Reporter
3
+ A Silent reporter for `node:test`, in case you don't want to see any output.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install --save-dev @reporters/silent
9
+ ```
10
+ or
11
+ ```bash
12
+ yarn add --dev @reporters/silent
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ node --test --test-reporter=@reporters/silent
19
+ ```
20
+
21
+ the output will be empty, but the tests will still run,
22
+ and the exit code will be 0 if all tests pass, and 1 if any test fails.
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ // eslint-disable-next-line require-yield
2
+ module.exports = async function* silent(source) {
3
+ // eslint-disable-next-line no-unused-vars
4
+ for await (const event of source);
5
+ };
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@reporters/silent",
3
+ "version": "1.0.0",
4
+ "description": "A silent reporter for `node:test`",
5
+ "keywords": [
6
+ "node:test",
7
+ "test",
8
+ "reporter",
9
+ "reporters"
10
+ ],
11
+ "scripts": {
12
+ "test": "../../prebuilt --test"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/MoLow/reporters/issues"
16
+ },
17
+ "main": "index.js",
18
+ "homepage": "https://github.com/MoLow/reporters/tree/main/packages/silent",
19
+ "repository": "https://github.com/MoLow/reporters.git",
20
+ "author": "Moshe Atlow",
21
+ "license": "MIT"
22
+ }
@@ -0,0 +1,7 @@
1
+ const { spawnSync } = require('child_process');
2
+ const assert = require('assert');
3
+
4
+ const child = spawnSync(process.execPath, ['--test-reporter', './index.js', '../../tests/example']);
5
+
6
+ assert.strictEqual(child.stderr?.toString(), '');
7
+ assert.strictEqual(child.stdout?.toString(), '');