import { compute_zscore, compute_zscore_adjusted, anthro_zscore_adjusted, adjust_lenhei, flag_zscore, apply_zscore_and_growthstandards } from './z-score-helper'; import { round } from './utils' describe('Zscore helper', () => { test('It computes a zscore correctly', () => { expect(compute_zscore(50, 56.4833, 1, 0.03492)).toEqual(((50 / 56.4833)**1 - 1) / (0.03492 * 1)) }); test('It computes an adjusted zscore correctly', () => { expect(round(compute_zscore_adjusted(17, 16.433, -0.3387, 0.14051),2)).toEqual(0.24) }); test('It computes apply zscore and growthstandards correctly', () => { expect(apply_zscore_and_growthstandards(compute_zscore_adjusted,'weianthro',1522,2, 17 )).toEqual(0.24) }); })