Open KLarpen opened 11 months ago
I had found temporary workaround.
/node_modules/tap-mocha-reporter/lib/runner.js
reviveStack
at line 286 function reviveStack (stack) {
if (!stack)
return null
return stack.trim().split('\n').map(function (line) {
return ' at ' + line
}).join('\n')
}
function reviveStack (stack) {
if (!stack)
return null
// TypeError: stack.trim is not a function
// return stack.trim().split('\n').map(function (line) {
// return ' at ' + line
// }).join('\n')
// Workaround
return stack.toString();
}
Result of running npm t
with the same setup as described above
Node v20.9.0 (v8 11.3.244.8-node.16):
Certificate request self-signature ok
subject=CN = localhost
lib/application ..................................... 21/21
lib/deps .............................................. 8/8
lib/procedure ....................................... 24/24
lib/procedure validate ................................ 4/4
schemas/contracts ..................................... 1/1
lib/api load ........................................ 22/22
lib/place ........................................... 18/18
schemas/config ........................................ 4/4
lib/bus ............................................. 11/11
lib/cert .............................................. 4/4
lib/code ............................................ 11/11
lib/static load ..................................... 11/11
lib/procedure timeout ................................. 0/2
not ok rejects
--- wanted
+++ found
-[null]
+"success"
message: expected to be rejected, but was resolved
severity: fail
type: rejects
at:
file: /test/procedure.js
stack: >
async ImperativeTest.func
(/test/procedure.js:137:3)
not ok fail
--- wanted
+++ found
-[null]
+"success"
message: Promise rejection
severity: fail
type: fail
at:
file: /test/procedure.js
stack: ""
lib/procedure validate async .......................... 4/4
FAILED test 14
Failed 1/15 tests, 93.33% okay
FYI @lundibundi
Fix in https://github.com/tapjs/tap-mocha-reporter/pull/79.
We can downgrade to tap-mocha-reporter@5.0.3 if that will be an issue for long.
Is your feature request related to a problem? Please describe.
I had encounter an issue when trying to look intended test fail results of Impress. Way to reproduce:
metatests.testAsync('lib/procedure timeout'
change the value of
waitTime
to 50. So the assertion must failed due to test configuration.npm t
metatest
package itself (more specifically from one of its dependencytap-mocha-reporter
)TypeError: stack.trim is not a function at reviveStack (/node_modules/tap-mocha-reporter/lib/runner.js:293:18) at getError (/node_modules/tap-mocha-reporter/lib/runner.js:332:87) at emitTest (/node_modules/tap-mocha-reporter/lib/runner.js:280:17) at Parser. (/node_modules/tap-mocha-reporter/lib/runner.js:219:5)
at Parser.emit (node:events:514:28)
at Parser.emit (node:domain:488:12)
at Parser.emit (/node_modules/minipass/index.js:483:23)
at Parser.emitAssert (/node_modules/tap-parser/index.js:864:10)
at Parser.emitResult (/node_modules/tap-parser/index.js:733:10)
at Parser.plan (/node_modules/tap-parser/index.js:417:10)
Unfortunately still had not found the temporary solution.
Additional context
OS: macOS 14.1.2 Node: 20.9.0, 18.18.2 Impress: 3.0.13 Metatests: 0.8.2