@small-tech/tap-monkey 1.5.0 → 1.6.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 +6 -0
- package/index.js +10 -0
- package/package.json +1 -1
- package/tests/index.js +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ 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.0] - 2025-12-29
|
|
8
|
+
|
|
9
|
+
Bail-on-fail monkey.
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
7
13
|
## [1.5.0] - 2025-12-29
|
|
8
14
|
|
|
9
15
|
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()
|
|
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
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
|
|