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
- Host: GitHub
- URL: https://github.com/math2001/testrjs
- Owner: math2001
- Created: 2016-12-20T04:54:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-20T04:57:40.000Z (over 9 years ago)
- Last Synced: 2025-01-06T20:52:27.926Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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...