UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

53 lines (40 loc) 1.12 kB
StartTest(function(t) { t.it('Should parse stack trace', function (t) { var stack, parsed; var exception try { a = b; } catch (e) { exception = e stack = e.stack; parsed = t.getStackTrace(e); } if (stack) { t.isGreater(parsed.length, 1, 'Should find a sane stack'); Ext.each(parsed, function(line, i) { t.ok(line, line) }); } }) t.it('Should parse stack trace with built-in functions', function (t) { var stack, parsed; var exception try { [ 'el' ].map(function () { a = b; }) } catch (e) { exception = e stack = e.stack; parsed = t.getStackTrace(e); } if (stack) { t.isGreater(parsed.length, 1, 'Should find a sane stack'); Ext.each(parsed, function(line, i) { t.ok(line, line) }); } }) })