What is the error with my code for assertions tests in Javascripts?

Hi I am trying to do assertion tests on javascript using mocha and chai but it seems the test cannot trigger the functions inside the source code file (script.js).

Can anyone explain to me what’s wrong and how should i code it so it would work? Thanks.

Script.js

function addChar(input, character) {
    if(input.value == null || input.value == "0")
        input.value = character
    else
        input.value += character
}

function cos(form) {
    form.display.value = Math.cos(form.display.value);
}

function sin(form) {
    form.display.value = Math.sin(form.display.value);
}

function tan(form) {
    form.display.value = Math.tan(form.display.value);
}

function sqrt(form) {
    form.display.value = Math.sqrt(form.display.value);
}

function ln(form) {
    form.display.value = Math.log(form.display.value);
}

function exp(form) {
    form.display.value = Math.exp(form.display.value);
}

function deleteChar(input) {
    input.value = input.value.substring(0, input.value.length - 1)
}
var val = 0.0;
function percent(input) {
  val = input.value;
  input.value = input.value + "%";
}

function changeSign(input) {
    if(input.value.substring(0, 1) == "-")
        input.value = input.value.substring(1, input.value.length)
    else
        input.value = "-" + input.value
}

function compute(form) {
  //if (val !== 0.0) {
   // var percent = form.display.value;  
   // percent = pcent.substring(percent.indexOf("%")+1);
   // form.display.value = parseFloat(percent)/100 * val;
    //val = 0.0;
 // } else 
    form.display.value = eval(form.display.value);
  }


function square(form) {
    form.display.value = eval(form.display.value) * eval(form.display.value)
}

function checkNum(str) {
    for (var i = 0; i < str.length; i++) {
        var ch = str.charAt(i);
        if (ch < "0" || ch > "9") {
            if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "."
                && ch != "(" && ch!= ")" && ch != "%") {
                alert("invalid entry!")
                return false
                }
            }
        }
        return true
}

Test.js

var assert = require('assert');
var addChar = require('../src/script').addChar;
var cos = require('../src/script').cos;
var sin = require('../src/script').sin;
var tan = require('../src/script').tan;
var sqrt = require('../src/script').sqrt;
var ln = require('../src/script').ln;
var exp = require('../src/script').exp;
var deleteChar = require('../src/script').deleteChar;
var changeSign = require('../src/script').changeSign;
var compute = require('../src/script').compute;
var square = require('../src/script').square;
var percent = require('../src/script').percent;
var checkNum = require('../src/script').checkNum;

describe('addChar()', function () {
    it('should add character to the input', function () {
        var input = { value: '123' };
        addChar(input, '4');
        assert.equal(input.value, '1234');
    });
});

describe('cos()', function () {
    it('should return the cosine of the input', function () {
        var form = { display: { value: '0' } };
        cos(form);
        assert.equal(form.display.value, '1');
    });
});

describe('sin()', function () {
    it('should return the sine of the input', function () {
        var form = { display: { value: '0' } };
        sin(form);
        assert.equal(form.display.value, '0');
    });
});

describe('tan()', function () {
    it('should return the tangent of the input', function () {
        var form = { display: { value: '0' } };
        tan(form);
        assert.equal(form.display.value, '0');
    });
});

describe('sqrt()', function () {
    it('should return the square root of the input', function () {
        var form = { display: { value: '4' } };
        sqrt(form);
        assert.equal(form.display.value, '2');
    });
});

describe('ln()', function () {
    it('should return the natural logarithm of the input', function () {
        var form = { display: { value: '2.71828' } };
        ln(form);
        assert.equal(form.display.value, '1');
    });
});

describe('exp()', function () {
    it('should return e to the power of the input', function () {
        var form = { display: { value: '1' } };
        exp(form);
        assert.equal(form.display.value, '2.718281828459045');
    });
});

describe('deleteChar()', function () {
    it('should delete a character from the input', function () {
        var input = { value: '1234' };
        deleteChar(input);
        assert.equal(input.value, '123');
    });
});

describe('changeSign()', function () {
    it('should change the sign of the input', function () {
        var input = { value: '123' };
        changeSign(input);
        assert.equal(input.value, '-123');
    });
});

describe('compute()', function () {
    it('should compute the result of the input', function () {
        var form = { display: { value: '1+2' } };
        compute(form);
        assert.equal(form.display.value, '3');
    });
});

describe('square()', function () {
    it('should compute the square of the input', function () {
        var form = { display: { value: '4' } };
        square(form);
        assert.equal(form.display.value, '16');
    });
});


I am expecting it to pass the test but as of now the test will fail because either it complains the function is undefined or it cannot be found.