diff --git a/src/function/trigonometry/trigUnit.js b/src/function/trigonometry/trigUnit.js index 7d2ccc1f6d..bbe3c89085 100644 --- a/src/function/trigonometry/trigUnit.js +++ b/src/function/trigonometry/trigUnit.js @@ -4,7 +4,7 @@ export const createTrigUnit = /* #__PURE__ */ factory( 'trigUnit', ['typed'], ({ typed }) => ({ Unit: typed.referToSelf(self => x => { if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) { - throw new TypeError('Unit in function cot is no angle') + throw new TypeError('Unit in function ' + self.name + ' is no angle') } return typed.find(self, x.valueType())(x.value) }) diff --git a/test/unit-tests/function/trigonometry/cos.test.js b/test/unit-tests/function/trigonometry/cos.test.js index 28b24c62b4..37bdfd3ad9 100644 --- a/test/unit-tests/function/trigonometry/cos.test.js +++ b/test/unit-tests/function/trigonometry/cos.test.js @@ -92,7 +92,7 @@ describe('cos', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { cos(unit('5 celsius')) }) + assert.throws(function () { cos(unit('5 celsius')) }, /Unit in function cos is no angle/) }) it('should throw an error if called with a string', function () { diff --git a/test/unit-tests/function/trigonometry/cot.test.js b/test/unit-tests/function/trigonometry/cot.test.js index 36e4518411..ec8b43c554 100644 --- a/test/unit-tests/function/trigonometry/cot.test.js +++ b/test/unit-tests/function/trigonometry/cot.test.js @@ -69,7 +69,7 @@ describe('cot', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { cot(unit('5 celsius')) }) + assert.throws(function () { cot(unit('5 celsius')) }, /Unit in function cot is no angle/) }) it('should throw an error if called with a string', function () { diff --git a/test/unit-tests/function/trigonometry/csc.test.js b/test/unit-tests/function/trigonometry/csc.test.js index 5693149eca..8f8cdb3044 100644 --- a/test/unit-tests/function/trigonometry/csc.test.js +++ b/test/unit-tests/function/trigonometry/csc.test.js @@ -64,7 +64,7 @@ describe('csc', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { csc(unit('5 celsius')) }) + assert.throws(function () { csc(unit('5 celsius')) }, /Unit in function csc is no angle/) }) it('should throw an error if called with a string', function () { diff --git a/test/unit-tests/function/trigonometry/sec.test.js b/test/unit-tests/function/trigonometry/sec.test.js index 755f2ceb73..b749a16430 100644 --- a/test/unit-tests/function/trigonometry/sec.test.js +++ b/test/unit-tests/function/trigonometry/sec.test.js @@ -80,7 +80,7 @@ describe('sec', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { sec(unit('5 celsius')) }) + assert.throws(function () { sec(unit('5 celsius')) }, /Unit in function sec is no angle/) }) it('should throw an error if called with a string', function () { diff --git a/test/unit-tests/function/trigonometry/sin.test.js b/test/unit-tests/function/trigonometry/sin.test.js index 231149b97b..72ae3974ee 100644 --- a/test/unit-tests/function/trigonometry/sin.test.js +++ b/test/unit-tests/function/trigonometry/sin.test.js @@ -95,7 +95,7 @@ describe('sin', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { sin(unit('5 celsius')) }) + assert.throws(function () { sin(unit('5 celsius')) }, /Unit in function sin is no angle/) }) it('should throw an error if called with a string', function () { diff --git a/test/unit-tests/function/trigonometry/tan.test.js b/test/unit-tests/function/trigonometry/tan.test.js index 90b6e6c13a..2847939bca 100644 --- a/test/unit-tests/function/trigonometry/tan.test.js +++ b/test/unit-tests/function/trigonometry/tan.test.js @@ -64,7 +64,7 @@ describe('tan', function () { }) it('should throw an error if called with an invalid unit', function () { - assert.throws(function () { tan(unit('5 celsius')) }) + assert.throws(function () { tan(unit('5 celsius')) }, /Unit in function tan is no angle/) }) it('should throw an error if called with a string', function () {