0.1.0 • Published 7 years ago

pureye v0.1.0

Weekly downloads
2
License
AGPLv3
Repository
github
Last release
7 years ago

Pureye

Test runners and continuous integration tools are fine for checking your overall coverage and ensure that no unexpected changes are introduced to the codebase. However, they are not quite convenient for the daily work, as the feedback loop for source code changes is relatively long. Pureye is a simple file watcher whose purpose is to provide you with immediate feedback over the updates you do on your code.

It works by observing your project's files by pairs. Imagine you have a file add.js with the following content:

const add = (a, b) => a + b

You might keep a battery of tests for it in a file add.test.js; you could start by:

assert('2 plus 2 should be 4', () => add(2, 2) === 4)

Whenever you change either add.js or add.test.js, both will be joined together and evaluated. You will see the results in the terminal in the blink of an eye.

As shown in the example, to write the tests a global function assert(message, assertion) is available. It accepts a description of the test as the first argument and a boolean-returning function as the second argument. If the assertion function returns true, the test will be considered passed, whereas if it returns false, we will say the test failed.

To start using the tool, place yourself at the root of your project and run the command. No arguments are needed, as the tool will try to figure out your project's conventions automatically, but you may configure some parameters through a 'pureye.json' file placed on the root of your project. You can see an example of it in the examples directory.

At the current stage, the tool is quite limited, only supporting pure functions. It would be a good idea for future development to extend it to support a wider variety of execution environments, covering both client- and server-side needs.