2 var Testem = window.Testem
3 var regex = /^((?:not )?ok) (\d+) (.+)$/
5 Testem.useCustomAdapter(tapAdapter)
7 function tapAdapter(socket){
15 socket.emit('tests-start')
17 Testem.handleConsoleMessage = function(msg){
18 var m = msg.match(regex)
20 var passed = m[1] === 'ok'
22 passed: passed ? 1 : 0,
23 failed: passed ? 0 : 1,
38 socket.emit('test-result', test)
39 results.tests.push(test)
40 } else if (msg === '# ok' || msg.match(/^# tests \d+/)){
41 socket.emit('all-test-results', results)
44 // return false if you want to prevent the console message from
45 // going to the console