-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.spec.ts
58 lines (51 loc) · 1.21 KB
/
index.spec.ts
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import ngBanks from '..';
import banks from '../banks';
import { Bank } from '../types';
describe('NGBank', function () {
it('should getbanks', () => {
expect(ngBanks.getBanks()).toHaveLength(banks.length);
});
it('should getbanks with callback', (done) => {
ngBanks.getBanks(function (err, data) {
expect(err).toBeNull();
expect(ngBanks.getBanks()).toHaveLength(banks.length);
done();
});
});
it('should getbank with slug', () => {
expect(ngBanks.getBank('EBN')).toEqual({
name: 'ECOBANK NIGERIA',
code: '050',
slug: 'EBN',
ussd: {
code: '*326#',
},
});
});
it('should getbank with callback', function (done) {
expect(
ngBanks.getBank('EBN', (err, data) => {
expect(err).toBeNull();
expect(data).toEqual({
name: 'ECOBANK NIGERIA',
code: '050',
slug: 'EBN',
ussd: {
code: '*326#',
},
});
done();
})
);
});
it('should getbank by bank code', () => {
expect(ngBanks.getBank('050')).toEqual({
name: 'ECOBANK NIGERIA',
code: '050',
slug: 'EBN',
ussd: {
code: '*326#',
},
});
});
});