src/parser.js
function parseExampleLine(left, right, result){
  if(!left || !right)return false; // did not find test
  
  if(right === 'setup' || right === 'teardown'){
    result[right].push(left);
  }else{
    var test = {
      left: wrapEval(left),
      title: (left + ' // ' + right).replace(/"/g, '\\"')
    };

    if(right === 'throws'){
      test.type  = right;
      test.right = '';
    }else{
      test.type  = 'deepEqual';
      test.right = right;
    }

    // MAYBE TODO: Filter strings to reduce false positives
    if(RegExp(matchIdentifierName('done')).test(left)){
      test.type += 'Async'; 
    }

    result.tests.push(test);
  } 
  return true;
}
function parseExampleLine(left, right, result){
  if(!left || !right)return false; // did not find test
  
  if(right === 'setup' || right === 'teardown'){
    result[right].push(left);
  }else{
    var test = {
      left: wrapEval(left),
      title: (left + ' // ' + right).replace(/"/g, '\\"')
    };

    if(right === 'throws'){
      test.type  = right;
      test.right = '';
    }else{
      test.type  = 'deepEqual';
      test.right = right;
    }

    // MAYBE TODO: Filter strings to reduce false positives
    if(RegExp(matchIdentifierName('done')).test(left)){
      test.type += 'Async'; 
    }

    result.tests.push(test);
  } 
  return true;
}
function parseExampleLine ( left , right , result ) { if ( ! left || ! right ) return false ; // did not find test if ( right === 'setup' || right === 'teardown' ) { result [ right ] . push ( left ) ; } else { var test = { left : wrapEval ( left ) , title : ( left + ' // ' + right ) . replace ( / " / g , '\\"' ) } ; if ( right === 'throws' ) { test . type = right ; test . right = '' ; } else { test . type = 'deepEqual' ; test . right = right ; } // MAYBE TODO: Filter strings to reduce false positives if ( RegExp ( matchIdentifierName ( 'done' ) ) . test ( left ) ) { test . type += 'Async' ; } result . tests . push ( test ) ; } return true ; }
Parses an example line
@private
Parses an example line