0.0.1 • Published 2 years ago

pytte v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

🧚 PYTTE TINY TEST RUNNER 🧚

npm i --save-dev pytte

A light weight test runner made for running tests inside source files

Like so

export function addNumbers(a, b) {
  return a + b;
}

// Export a "tests" object from your file
export const tests = {
  "should run a test in an object": (assert) => {
    assert(addNumbers(1, 2) === 3);
  },
};

// Or a function
export function tests(it, assert) {
  it("should run a test in a function", () => {
    assert(addNumbers(1, 2) === 3);
  });
}

Then use it with

pytte -d path/to/your/sourcefiles/
0.0.1

2 years ago