fail-on-console 1.4.0 → 1.4.2
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 +14 -0
- package/README.md +1 -0
- package/index.js +4 -0
- package/package.json +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.2](https://github.com/benquarmby/fail-on-console/compare/v1.4.1...v1.4.2) (2026-08-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* properly document custom format option ([5456c53](https://github.com/benquarmby/fail-on-console/commit/5456c533f423beded7a4d1e9046beb29c26e420b))
|
|
9
|
+
|
|
10
|
+
## [1.4.1](https://github.com/benquarmby/fail-on-console/compare/v1.4.0...v1.4.1) (2026-08-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add defense for missing hooks ([6e5323b](https://github.com/benquarmby/fail-on-console/commit/6e5323b433dce8cfa5ad9e9ffd911c648d8721c6))
|
|
16
|
+
|
|
3
17
|
## [1.4.0](https://github.com/benquarmby/fail-on-console/compare/v1.3.1...v1.4.0) (2026-08-08)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -114,6 +114,7 @@ Initializes console spies that monitor active tests.
|
|
|
114
114
|
|
|
115
115
|
- `options.beforeEach`: The framework's `beforeEach` hook.
|
|
116
116
|
- `options.afterEach`: The framework's `afterEach` hook.
|
|
117
|
+
- `options.format`: _(Optional)_ A custom `printf`-like console message formatter. Defaults to a basic implementation.
|
|
117
118
|
- `options.methods`: _(Optional)_ Array of `console` methods to track. Defaults to `["error", "warn", "info", "log"]`.
|
|
118
119
|
- `options.streams`: _(Optional)_ Array of `process` streams to track. Defaults to `[]` (no streams monitored).
|
|
119
120
|
|
package/index.js
CHANGED
|
@@ -115,6 +115,10 @@ function setupConsole({
|
|
|
115
115
|
throw new Error("fail-on-console: Call setupConsole() only once.");
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
if (typeof beforeEach !== "function" || typeof afterEach !== "function") {
|
|
119
|
+
throw new Error("fail-on-console: beforeEach and afterEach hooks must be provided.");
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
assertSupportedMethods(methods);
|
|
119
123
|
assertSupportedStreams(streams);
|
|
120
124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fail-on-console",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Fail Vitest or Jest tests when unexpected console logs, warnings or errors occur.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -19,15 +19,23 @@
|
|
|
19
19
|
"./index.d.ts"
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@commitlint/config-conventional": "^21.2.
|
|
23
|
-
"@vitest/coverage-v8": "4.1.
|
|
24
|
-
"commitlint": "^21.2.
|
|
22
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
23
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
24
|
+
"commitlint": "^21.2.2",
|
|
25
25
|
"jest": "^30.4.2",
|
|
26
26
|
"npm-run-all2": "^9.0.3",
|
|
27
27
|
"prettier": "^3.9.6",
|
|
28
28
|
"prettier-plugin-packagejson": "^3.0.2",
|
|
29
29
|
"typescript": "^7.0.2",
|
|
30
|
-
"vitest": "^4.1.
|
|
30
|
+
"vitest": "^4.1.11",
|
|
31
|
+
"node": "runtime:24.19.0"
|
|
32
|
+
},
|
|
33
|
+
"devEngines": {
|
|
34
|
+
"runtime": {
|
|
35
|
+
"name": "node",
|
|
36
|
+
"version": "24.19.0",
|
|
37
|
+
"onFail": "download"
|
|
38
|
+
}
|
|
31
39
|
},
|
|
32
40
|
"scripts": {
|
|
33
41
|
"commit:check": "commitlint --from-last-tag",
|