This repository was archived by the owner on Sep 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
42 lines (34 loc) · 1.21 KB
/
test.js
File metadata and controls
42 lines (34 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let assert = require('chai').assert,
expect = require('chai').expect,
hashZeus = require('./index');
describe('Foundation tests', ()=> {
it('hashZeus should generate a value', ()=> {
let test = new hashZeus();
let hash = test.generateHash();
assert.isNotNull(hash);
assert.isNotEmpty(hash);
});
it('hashZeus should generate a string', ()=> {
let test = new hashZeus();
let hash = test.generateHash();
assert.isString(hash);
});
it('The service name appending function should append service name to the hash', ()=> {
let test = new hashZeus();
let hash = test.generateHash('zerodha');
expect(hash).to.match(/(?:zerodha)/)
});
it('hashes from differnt objects should not be same', ()=> {
let test = new hashZeus();
let hash = test.generateHash();
let test1 = new hashZeus();
let hash1 = test1.generateHash();
assert.notEqual(hash, hash1);
});
it('Hashes from same object should be Monotonically increasing', () => {
let test = new hashZeus();
let hash = test.generateHash();
let hash1 = test.generateHash();
assert(hash < hash1);
});
});