25 lines
774 B
JavaScript
25 lines
774 B
JavaScript
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);
|
||
});
|