@small-tech/tap-monkey 1.5.0 → 1.6.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
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.6.1] - 2025-12-29
8
+
9
+ Silly monkey.
10
+
11
+ - Actually exit with error when when bailing on fail (instead of with success code) 🙊
12
+
13
+ ## [1.6.0] - 2025-12-29
14
+
15
+ Bail-on-fail monkey.
16
+
17
+ - If you want the process to exit on first failure (e.g., you’re running your unit tests continuously until you hit an unpredictably-reproduced failure), set the `BAIL_ON_FAIL` environment flag before running the tests.
18
+
7
19
  ## [1.5.0] - 2025-12-29
8
20
 
9
21
  Maintenance monkey.
package/index.js CHANGED
@@ -88,6 +88,16 @@ const failHandler = (assert => {
88
88
  console.log(' ', chalk.red(line))
89
89
  })
90
90
 
91
+ if (process.env.BAIL_ON_FAIL) {
92
+ /* c8 ignore next */
93
+ if (!process.env.DONT_ACTUALLY_BAIL_ON_FAIL) {
94
+ /* c8 ignore next */
95
+ process.exit(1)
96
+ } else {
97
+ return 'I pretended to bail on fail.'
98
+ }
99
+ }
100
+
91
101
  spinner.start()
92
102
  })
93
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@small-tech/tap-monkey",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "A tap formatter that’s also a monkey.",
5
5
  "keywords": [
6
6
  "tap",
package/tests/index.js CHANGED
@@ -162,6 +162,17 @@ test('fail handler', t => {
162
162
  t.true(output.includes('expected: true'), 'output should include expected field')
163
163
  t.true(output.includes('actual : false'), 'output should include actual field')
164
164
 
165
+ // Test bail on fail environment flag.
166
+ process.env.BAIL_ON_FAIL = 'true'
167
+ process.env.DONT_ACTUALLY_BAIL_ON_FAIL = 'true'
168
+ console.log = capturedConsoleLog
169
+ const mockResult = tapMonkey.failHandler(regularFailedAssertion)
170
+ delete process.env.BAIL_ON_FAIL
171
+ delete process.env.DONT_ACTUALLY_BAIL_ON_FAIL
172
+ console.log = originalConsoleLog
173
+
174
+ t.strictEquals(mockResult, 'I pretended to bail on fail.', 'Bail on fail works.')
175
+
165
176
  t.end()
166
177
  })
167
178