vuex-bitshares
Version:
Vue way to build DAP's on bitshares net
30 lines (28 loc) • 761 B
JavaScript
/* eslint-env jest */
import * as utils from '../src/utils';
describe('market service', () => {
test('samples distribution to specified accuracy', () => {
expect(utils.distributionSampling(
{
'1.3.0': 0.5700268982667804,
'1.3.113': 0.10582752186532557,
'1.3.121': 0.000043214634294735743,
'1.3.861': 0.00006169457659182669,
'1.3.973': 0.06378792759388024,
'1.3.1042': 0.00011144826739168692,
'1.3.1578': 0.26011570718332416,
'1.3.1999': 0.00002558761241135669
},
2
)).toEqual({
'1.3.113': 0.11,
'1.3.973': 0.06,
'1.3.1578': 0.26,
'1.3.1042': 0,
'1.3.861': 0,
'1.3.121': 0,
'1.3.0': 0.57,
'1.3.1999': 0
});
});
});