Browse Source

[docs] Updated docs for multiple expect and run options

0.7.0-breaking-rewrite
Muthu Kumar 6 years ago
parent
commit
878a48b26d
  1. 20
      README.md
  2. 8
      package.json

20
README.md

@ -40,7 +40,7 @@ const gunner = new Gunner(options);
### Gunner#test
Registers a new test.
Registers a new test. A test can have multiple expect statements. They should be returned as an array. The first expect to fail will cause the test to fail.
#### Usage
@ -49,14 +49,30 @@ gunner.test('sum should equal 3', expect => {
const sum = 1 + 2;
return expect(sum).equal(3);
});
gunner.test('multiple expects should be true', expect => {
const a = 1 + 2;
const b = 'Hello World';
return ([
expect(a).equal(3),
expect(b).equal('Goodbye World'),
]);
});
```
### Gunner#run
Starts running Gunner tests.
Starts running Gunner tests. Takes an options object as optional parameter.
#### Options
- **`log`** [default: true]: Turn logs on or off (returns array of results)
- **`trace`** [default: false]: Turn stack traces on or off
#### Usage
```JavaScript
const options = { logs: true, trace: true };
gunner.run(options);
```

8
package.json

@ -1,17 +1,15 @@
{
"name": "@klenty/gunner",
"version": "0.1.5",
"description": "Multi-strategy test runner.",
"version": "0.2.0",
"description": "Zero magic, fast test-runner and assertion framework. No magic globals.",
"main": "index.js",
"scripts": {
"test": "npm run start"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vengatkrishnaraj/gunner.git"
},
"keywords": [
"klenty",
"gunner",
"test",
"tdd",
"unit testing"

Loading…
Cancel
Save