metarhia / metatests

Extremely simple to use test framework and runner for Metarhia technology stack 🧪
https://metarhia.com
Other
18 stars 4 forks source link

Cannot read property 'stack' of null #231

Closed tshemsedinov closed 4 years ago

tshemsedinov commented 4 years ago

@lundibundi After update to the new version of metatests, testing metalog I get sometimes:

.../metalog/node_modules/metatests/lib/test.js:49
      stack: error.stack,
                   ^
TypeError: Cannot read property 'stack' of null
    at ImperativeTest.erroer (.../metalog/node_modules/metatests/lib/test.js:49:20)
    at Domain.<anonymous> (.../metalog/node_modules/metatests/lib/imperative-test.js:662:17)
    at Domain.emit (events.js:210:5)
    at Domain.EventEmitter.emit (domain.js:475:20)
    at Domain._errorHandler (domain.js:239:23)
    at Object.<anonymous> (domain.js:149:29)
    at process._fatalException (internal/process/execution.js:149:29)
tshemsedinov commented 4 years ago

I fixed this certain problem in metalog but metatests should react to such behavior in a different way.

lundibundi commented 4 years ago

Well, the only way I see this happening is if someone either throws unhandled exception which is null, or emits 'error' null. Though I'll fix that case. Perhaps you may have a reproduce of this?