forked from theQRL/nft-providers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
32 lines (30 loc) · 1.08 KB
/
test.js
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
var expect = require('chai').expect;
var qrlNft = require('./index.js');
var validate = require('@theqrl/validate-qrl-address')
describe('#qrlNft version', function() {
it(`.version should report same version as in npm package.json file (=${process.env.npm_package_version})`, function() {
var result = qrlNft.version;
expect(result).to.equal(process.env.npm_package_version);
});
});
describe('#providers', function() {
it(`should have some providers`, function() {
var result = qrlNft.providers.length;
expect(result).to.be.greaterThan(0);
});
it(`each provider should name / address(es) / url / id`, function() {
var result = qrlNft.providers;
result.forEach(provider => {
expect(provider).to.have.all.keys('name', 'addresses', 'url', 'id');;
});
});
it(`each provider QRL address should be valid`, function() {
var result = qrlNft.providers;
result.forEach(provider => {
const { addresses } = provider;
addresses.forEach(address => {
expect(validate.hexString(address).result).to.equal(true);
});
});
});
})