fail-on-console 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/benquarmby/fail-on-console/compare/v1.4.0...v1.4.1) (2026-08-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add defense for missing hooks ([6e5323b](https://github.com/benquarmby/fail-on-console/commit/6e5323b433dce8cfa5ad9e9ffd911c648d8721c6))
9
+
3
10
  ## [1.4.0](https://github.com/benquarmby/fail-on-console/compare/v1.3.1...v1.4.0) (2026-08-08)
4
11
 
5
12
 
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.0",
3
+ "version": "1.4.1",
4
4
  "description": "Fail Vitest or Jest tests when unexpected console logs, warnings or errors occur.",
5
5
  "keywords": [
6
6
  "jest",
@@ -19,9 +19,9 @@
19
19
  "./index.d.ts"
20
20
  ],
21
21
  "devDependencies": {
22
- "@commitlint/config-conventional": "^21.2.0",
22
+ "@commitlint/config-conventional": "^21.2.2",
23
23
  "@vitest/coverage-v8": "4.1.10",
24
- "commitlint": "^21.2.1",
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",