Files
2026-09-14 22:38:47 -04:00

25 lines
774 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import test from 'node:test';
import assert from 'node:assert/strict';
import {
isCorrectTotal,
isCorrectEquation,
hasReasoningEvidence,
} from '../src/session.mjs';
test('accepts the total for seven groups of two', () => {
assert.equal(isCorrectTotal('14'), true);
});
test('rejects an incorrect total for seven groups of two', () => {
assert.equal(isCorrectTotal('13'), false);
});
test('accepts an equivalent multiplication equation', () => {
assert.equal(isCorrectEquation('2 × 7 = 14'), true);
});
test('requires a learner explanation to name groups or repeated addition and the total', () => {
assert.equal(hasReasoningEvidence('There are 7 groups of 2, so there are 14 shoes.'), true);
assert.equal(hasReasoningEvidence('It is 14.'), false);
});