0.11.0 • Published 7 days ago

self-explain v0.11.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 days ago

self-explained

self explained tools - starting with "assert"

Install

$ npm install self-explained

extending npm-version downloads build coverage climate dependencies qa-control

language: English also available in: Spanish

Use

var assert = require('self-exlain').assert;

var alpha = 10;
var betha = 7;

assert(alpha / 2 > betha -1);

It controls the expression like assert does. If the expression evaluates to false it will show the expression and the value. (also throws the Exception)

ASSERT FAILED
alpha / 2 > betha -1 ==== false

Much more info

var assert = require('self-exlain').assert;

var alpha = 10;
var betha = 7;

eval(assert(alpha / 2 > betha -1));

Adding eval to the assert It will shows the evaluation of all subexpressions

ASSERT FAILED
alpha / 2 > betha -1 ==== false
alpha / 2 ==== 5
betha -1 ==== 6
alpha ==== 10
betha ==== 7

Exceptions

Function assertCatch controls that an Error been throwed.

assertCatch(function{
    if(error){
        throw new Error('an error');
    }
}, /an error/);

Tests with real devices

NPM versionDeviceOSnav
0.10.0HTC DesireAndroid 2.2.2Android 2.2.2
0.10.0Samgsung Galaxy Note 4Android 5.1.1Samsung Internet 4.0.0
0.10.2Samgsung Galaxy Note 4Android 6.0.1Chrome Mobile 50.0.2661
0.10.0Blue Vivo Air LTEAndroid 5.0.2Chrome Mobile 50.0.2661
0.10.0iPad mini RetinaiOS 8.4.0Mobile Safari 8.0.0
0.10.0VMWareWinXPIE 8.0.0

License

MIT

0.11.0

7 days ago

0.10.22

4 years ago

0.10.21

5 years ago

0.10.20

5 years ago

0.10.18

6 years ago

0.10.17

6 years ago

0.10.16

7 years ago

0.10.15

7 years ago

0.10.13

7 years ago

0.10.12

7 years ago

0.10.11

7 years ago

0.10.10

7 years ago

0.10.9

8 years ago

0.10.8

8 years ago

0.10.7

8 years ago

0.10.6

8 years ago

0.10.5

8 years ago

0.10.4

8 years ago

0.10.3

8 years ago

0.10.2

8 years ago

0.10.1

8 years ago

0.10.0

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago