An open API service indexing awesome lists of open source software.

https://github.com/math2001/testrjs

A javascript test library inspired by python
https://github.com/math2001/testrjs

Last synced: over 1 year ago
JSON representation

A javascript test library inspired by python

Awesome Lists containing this project

README

          

# Testr

Testr is a javascript mini library that helps you running some test. It is hugely inspired by the unitest in python.

How to use:

```html

```

```js
// app.js

class MyClassTestr extends Testr {

checkAttr() {
this.assertDefined(this.hello)
this.assertDefined(this.world)

this.assertEqual(typeof this.hello, 'string')
this.assertEqual(typeof this.world, 'number')
}

}
Testr.run(MyClassTestr)
```

For now, here are the function there is:

- `assertEqual`
- `assertNotEqual`
- `assertDefined` (a shortcut for `assertNotEqual(typeof myVar, 'undefined')`)

More to come...