0.0.7 • Published 7 years ago

kangaroo-testrunner v0.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Kangaroo-Testrunner

A drop-dead simple test runner. No batteries included.

Kangaroo is a test runner that basically just iterates over an array of tests, executes the provided test cases and shows how many tests did not pass. Tests are provided as tuples of a message that describes the test and a lambda containing the test. You are free to do whatever you like inside the lambda, no assumptions made. The test fails if an exception is thrown. Kangaroo can be bundled using rollup or other package managers, testing from inside the test specific bundle.

(Kangaroo offers no features beyond simply executing the tests, no asynchronicity, spies, nothing)

Usage:

Installation:

npm install https://github.com/sdwio/kangaroo-testrunner --save-dev

What a single test looks like (using expect as test library):

BREAKING CHANGE: since 0.0.7 kangaroo expects a truthy value to be (simply change existing tests to return expect(...)... or return true), tests not returning anything or falsy value will be shown as pending

let test_1 = [
  'checks output of aFunction',
  () => {
    let expectedResult = { foo: 'bar' }
    let result = aFunction()
    return expect(result).toEqual(expectedResult)
  }
]

Running tests:

import { kangaroo } from 'kangaroo-testrunner'
/*...*/
let tests = [test_1, test_2, test_3]
kangaroo(tests)

Output:

......
checks output of aFunction failed
Error: Expected { foo: 'qux' } to equal { foo: 'bar' }

>>>>> ONE FAILURE <<<<<
0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago