Skip to content

Repository files navigation

Scientist

npm Build Status Coverage Status

Table of contents

How it works

So you just refactored a swath of code and all tests pass. You feel completely confident that this can go to production. Right? In reality, not so much. Be it poor test coverage or just that the refactored code is very critical, sometimes you need more reassurance.

Scientist lets you run your refactored code alongside the actual code, comparing the outputs and logging when it did not return as expected. It's heavily based on GitHub's Scientist gem. Let's walk through an example. Start with this code:

const sumList = (arr) => {
  let sum = 0;
  for (var i of arr) {
    sum += i;