UNPKG

1.78 kBMarkdownView Raw
1# Gunner
2
3<img alt="Django Unchained" src="https://raw.githubusercontent.com/klenty/Gunner/master/assets/gun.jpeg" height="350" />
4
5#### _Tiny, but fully loaded._
6
7> Gunner is a zero magic, fast test-runner and assertion framework. There are no magic globals or CLI specific interface.
8
9## Requirements & Usage
10
11`Gunner` uses very modern JavaScript, and hence requires **node 10+** ❗️⚠️ currently.
12
13Create a new `Gunner` instance and simply write your tests. The assertion methods are passed in as the callback as an `expect` object to the test function.
14
15```JavaScript
16const { Gunner, expect } = require('@klenty/gunner');
17// Create new instance
18const gunner = new Gunner();
19
20// Define tests
21gunner.test('arrays are equal', () => {
22 return expect([1, 2,]).deepEqual([1 ,2]);
23});
24
25// Starts the runner
26gunner.run();
27```
28
29## Documentation
30
31- ### `Class`:
32 - #### [`Gunner.constructor`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#new-gunner-options)
33
34- ### `Methods`:
35 - #### [`Gunner#test`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnertest-title-implementation)
36 - #### [`Gunner#before`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerbefore-title-implementation)
37 - #### [`Gunner#after`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerafter-title-implementation)
38 - #### [`Gunner#run`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#gunnerrun-options)
39
40- ### `Constants`:
41 - #### `[Gunner.Start]`
42 - #### `[Gunner.End]`
43
44- ### [`State and Advanced Usage`](https://github.com/klenty/Gunner/blob/master/DOCUMENTATION.md#state)
45
46## Credits
47
48`Gunner` was built by Muthu Kumar [(@MKRhere)](https://github.com/MKRhere) at [Klenty](https://klenty.com), a sales automation startup.