<commit_before>fibonacci = function(n){
	return Math.round(Math.pow((Math.sqrt(5) + 1) / 2, Math.abs(n)) / Math.sqrt(5)) * (n < 0 && n % 2 ? -1 : 1);
};

var fib_result;

When(/^I ask Javascript to calculate fibonacci up to (\d+)$/, function(n){
  fib_result = fibonacci(n);
});

Then(/^it should give me (\[.*\])$/, function(n){
  expected_result = fibonacci(n)
  if(fib_result != expected_result){
    throw fib_result + " is not equal to " + expected_result;
  }
});<commit_msg>Now its really running the tests, get the javascript code to actually do what the feature specifies.<commit_after>function fibanacci(n){
  return n<2?n:fibanacci(n-1)+fibanacci(n-2);
}

var fibonacciSeries = function(topFibonacci) {
  var result = Array();
  var currentFibanacciValue = fibanacci(1);
  var i = 2;
  while(currentFibanacciValue < topFibonacci) {
    result.push(currentFibanacciValue);
    currentFibanacciValue  = fibanacci(i);
    i++;
  }
  return result;
}

var fib_result;

When(/^I ask Javascript to calculate fibonacci up to (\d+)$/, function(n){
  fib_result = fibonacciSeries(n);
});

Then(/^it should give me (\[.*\])$/, function(expected_result){
  fib_result = fib_result.join(",");
  if(fib_result != expected_result){
    throw 'Expected <' + expected_result + "> but got <" + fib_result + ">";
  }
});
{'fraction_non_alphanumeric': 0.16603198781416603, 'fraction_numerical': 0.009900990099009901, 'mean_word_length': 4.298387096774194, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1789170', 'n_tokens_mistral': 488, 'n_tokens_neox': 463, 'n_words': 113}