"use strict" const assert = require("assert") const { sum } = require("./sum.cjs") function testSumResult() { const a = 1 const b = 2 const result = sum(a, b) assert(result === a + b, "the result should be the sum of its arguments") } function testSumNoArgs() { try { sum() } catch (_) { return } assert.fail("should fail if not provided any arguments") } function testSumMissingArg() { const a = 1 try { sum(a) } catch (_) { return } assert.fail("should fail if not provided all arguments") } function testWillFail() { assert.fail("I have failed!") } module.exports = { testSumResult, testSumNoArgs, testSumMissingArg, testWillFail, }