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 ### 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 #### Usage
@ -49,14 +49,30 @@ gunner.test('sum should equal 3', expect => {
const sum = 1 + 2; const sum = 1 + 2;
return expect(sum).equal(3); 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 ### 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 #### Usage
```JavaScript ```JavaScript
const options = { logs: true, trace: true };
gunner.run(options); gunner.run(options);
``` ```

8
package.json

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

Loading…
Cancel
Save