fail-on-console 1.4.1 → 1.4.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/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/index.js +4 -0
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.3](https://github.com/benquarmby/fail-on-console/compare/v1.4.2...v1.4.3) (2026-09-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add defense for incorrect format argument ([717ee97](https://github.com/benquarmby/fail-on-console/commit/717ee97e815157a411b695e8c16a772f96eb1eec))
|
|
9
|
+
|
|
10
|
+
## [1.4.2](https://github.com/benquarmby/fail-on-console/compare/v1.4.1...v1.4.2) (2026-08-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* properly document custom format option ([5456c53](https://github.com/benquarmby/fail-on-console/commit/5456c533f423beded7a4d1e9046beb29c26e420b))
|
|
16
|
+
|
|
3
17
|
## [1.4.1](https://github.com/benquarmby/fail-on-console/compare/v1.4.0...v1.4.1) (2026-08-15)
|
|
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
|
@@ -119,6 +119,10 @@ function setupConsole({
|
|
|
119
119
|
throw new Error("fail-on-console: beforeEach and afterEach hooks must be provided.");
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
if (typeof format !== "function") {
|
|
123
|
+
throw new Error("fail-on-console: A custom formatter must be a function.");
|
|
124
|
+
}
|
|
125
|
+
|
|
122
126
|
assertSupportedMethods(methods);
|
|
123
127
|
assertSupportedStreams(streams);
|
|
124
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fail-on-console",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Fail Vitest or Jest tests when unexpected console logs, warnings or errors occur.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jest",
|
|
@@ -20,14 +20,21 @@
|
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@commitlint/config-conventional": "^21.2.2",
|
|
23
|
-
"@vitest/coverage-v8": "
|
|
23
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
24
24
|
"commitlint": "^21.2.2",
|
|
25
|
-
"jest": "^30.
|
|
25
|
+
"jest": "^30.5.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": "^
|
|
30
|
+
"vitest": "^5.0.1"
|
|
31
|
+
},
|
|
32
|
+
"devEngines": {
|
|
33
|
+
"runtime": {
|
|
34
|
+
"name": "node",
|
|
35
|
+
"version": "24.19.0",
|
|
36
|
+
"onFail": "download"
|
|
37
|
+
}
|
|
31
38
|
},
|
|
32
39
|
"scripts": {
|
|
33
40
|
"commit:check": "commitlint --from-last-tag",
|