-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report on the test.rejects failure not working #278
Comments
I had found temporary workaround.
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 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 tapjs/tap-mocha-reporter#79. We can downgrade to tap-mocha-reporter@5.0.3 if that will be an issue for long. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.4. Run
npm t
5. Instead of failed test report there is an error from reporting logic of
metatest
package itself (more specifically from one of its dependencytap-mocha-reporter
)Describe the solution you'd like
Introduce better reporters instead of tap-mocha-reporter as it was described in #265
Describe alternatives you've considered
Please propose temporary workaround. I had tried to investigate
function reviveStack
in/node_modules/tap-mocha-reporter/lib/runner.js:293
by addingconsole.debug({ stack, stackFile: stack.file })
. It seems that contract ofstack
that the function receives has been changed and even not stable to rely on: two internal subsequent calls resulting in string and objectUnfortunately 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
The text was updated successfully, but these errors were encountered: