UNPKG

als-statistics

Version:

Modular JS statistics toolkit for Node.js and the browser: descriptive stats, correlations (Pearson/Spearman/Kendall), t-tests & ANOVA (Student/Welch), reliability (Cronbach’s alpha), regression (linear/logistic), clustering (DBSCAN/HDBSCAN), and table/co

15 lines (13 loc) 651 B
import { describe, it } from 'node:test'; import assert from 'node:assert'; import { CompareMeans } from '../../../lib/analyze/compare-means/index.js'; describe('CompareMeans.oneSample default column pick', () => { it('uses the full first key name, not its first character', () => { const data = { Alpha: [1,2,3], Beta: [4,5,6] }; const cmp = new CompareMeans(data); // const t1 = cmp.oneSample(/* no name => should pick "Alpha" */, 2); const t1 = cmp.oneSample(undefined, 2); // if bug present (Object.keys(...)[0][0]), it tries key "A" instead of "Alpha" and crashes. assert.strictEqual(t1.df, 2); }); });