UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.

19 lines (14 loc) 518 B
var assert = require('assert'); var math = require('../../../../index'); var Chain = math.type.Chain; describe('chain', function() { it ('should construct a chain', function () { assert.ok(math.chain(45) instanceof Chain); assert.ok(math.chain(math.complex(2, 3)) instanceof Chain); assert.ok(math.chain() instanceof Chain); }); it('should LaTeX chain', function () { var expression = math.parse('chain(1)'); assert.equal(expression.toTex(), '\\mathrm{chain}\\left(1\\right)'); }); });